CN113094282B - Program block running method, device, equipment and storage medium - Google Patents

Program block running method, device, equipment and storage medium Download PDF

Info

Publication number
CN113094282B
CN113094282B CN202110469087.7A CN202110469087A CN113094282B CN 113094282 B CN113094282 B CN 113094282B CN 202110469087 A CN202110469087 A CN 202110469087A CN 113094282 B CN113094282 B CN 113094282B
Authority
CN
China
Prior art keywords
speed
program block
block
sliding operation
virtual object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110469087.7A
Other languages
Chinese (zh)
Other versions
CN113094282A (en
Inventor
吴企帅
王嘉威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110469087.7A priority Critical patent/CN113094282B/en
Publication of CN113094282A publication Critical patent/CN113094282A/en
Application granted granted Critical
Publication of CN113094282B publication Critical patent/CN113094282B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3628Software debugging of optimised code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a program block operation method, a device, equipment and a storage medium, and belongs to the technical field of computers. According to the program block operation mode, the operation speed adjusting function is provided, when the program block is operated, the operation speed of the program block can be changed through the operation of adjusting the operation speed of the program block, and then the program block is displayed through the change of the movement speed of the virtual object, so that the flexible and efficient program block debugging process is realized, for example, whether the movement of the virtual object is problematic or not is observed by adjusting the operation speed slowly, and therefore the position of an error program block is accurately determined without debugging the program block one by one. For example, when the program block runs smoothly, the running speed is adjusted to be faster, and the debugging process of the program block is completed rapidly, so that the method effectively improves the debugging efficiency of the program block.

Description

Program block running method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for running a program block.
Background
With the development of computer technology, in various fields, programs are obtained by programming to run programs to realize business requirements have become a trend. In some application scenarios, the written program is packaged into one program block, and programming can be simply and quickly completed by splicing the program blocks. After programming is complete, it is often necessary to run the blocks to see if there is an abnormality in the stitching of the blocks.
Currently, a block operation method generally performs an operation on a block, and a terminal may display an operation corresponding to the block in a block operation display area in response to the operation.
The running speed of the program blocks is fixed when the program blocks run, once a certain program block runs with errors, a user cannot directly know the position of the program block with the specific errors, only the end of the running of the program block can be reached, the program blocks are adjusted once and once again by self experience, and the program blocks run again until the running is free from errors. Therefore, the running method of the program blocks is fixed and single, the waiting time of debugging the program blocks is easy to be increased in the running process, the error program blocks cannot be positioned, and the debugging efficiency of the program blocks is low.
Disclosure of Invention
The embodiment of the application provides a program block running method, a device, equipment and a storage medium, and the debugging efficiency of the program block is improved. The technical scheme is as follows:
in one aspect, a method for running a program block is provided, the method comprising:
acquiring a program block, wherein the program block is used for controlling the movement of a virtual object;
responding to an operation instruction of the program block, and displaying a virtual object to move according to a first movement speed in a program block operation display area;
and responding to the operation speed adjustment operation of the program block, and displaying the virtual object to continue to move according to a second movement speed in the program block operation display area, wherein the second movement speed is different from the first movement speed.
In one aspect, there is provided a program block running apparatus, the apparatus comprising:
the acquisition module is used for acquiring a program block, wherein the program block is used for controlling the movement of the virtual object;
the display module is used for responding to the running instruction of the program block and displaying the virtual object to move according to the first movement speed in the program block running display area;
and the display module is also used for responding to the operation speed adjustment operation of the program block, and displaying the virtual object to continue to move according to a second movement speed in the program block operation display area, wherein the second movement speed is different from the first movement speed.
In some embodiments, the display module is configured to respond to an operation instruction for the program block, and display, in a program block operation display area, that the virtual object moves at a first movement speed corresponding to a first operation speed, where the first operation speed refers to an operation speed of the program block.
In some embodiments, the display module includes a determination unit and a display unit;
the determining unit is used for responding to the operation speed adjusting operation of the program block, and determining a second operation speed of the program block according to the first operation speed;
and the display unit is used for displaying that the virtual object continues to move according to the second movement speed corresponding to the second movement speed in the program block operation display area.
In some embodiments, the display module is configured to perform any one of:
responding to the sliding operation in the program block editing area, and displaying the virtual object to continue to move according to the second movement speed indicated by the sliding operation in the program block operation display area;
and responding to clicking operation of the operation speed adjustment control, and displaying the virtual object to continue to move according to a second movement speed in the program block operation display area, wherein the second movement speed corresponds to a second operation speed selected by the clicking operation.
In some embodiments, the determining unit is configured to determine, in response to a sliding operation in the block editing area, a second running speed according to any one of displacement, speed, or acceleration of the sliding operation, and the first running speed;
in some embodiments, the display unit is configured to display, in the block operation display area, that the virtual object continues to move according to a second movement speed corresponding to the second operation speed.
In some embodiments, the determining unit includes an acquisition subunit and a determining subunit;
the acquisition subunit is used for responding to the sliding operation in the program block editing area and acquiring any one of displacement, speed or acceleration of the sliding operation;
the determination subunit is configured to determine a second operation speed according to the first operation speed in response to a magnitude of any one of a displacement, a speed, or an acceleration of the sliding operation being greater than a threshold.
In some embodiments, the determining subunit is configured to determine, as the second operation speed, an operation speed adjacent to the first operation speed corresponding to the direction of the sliding operation, from among at least two operation speeds.
In some embodiments, the determining unit is configured to:
determining an operation speed adjusting value corresponding to the direction according to the direction of the sliding operation and the magnitude of any one of displacement, speed or acceleration of the sliding operation, wherein the absolute value of the operation speed adjusting value is positively related to the magnitude of any one of the displacement, speed or acceleration;
and determining a second operation speed according to the first operation speed and the operation speed adjustment value.
In some embodiments, the apparatus further comprises:
and a first ignoring module configured to ignore the sliding operation in response to a magnitude of any one of a displacement, a velocity, or an acceleration of the sliding operation being less than or equal to the threshold.
In some embodiments, the magnitude of any one of the displacement, velocity, or acceleration of the sliding operation is the magnitude of a component of the any one in the first direction or the second direction;
the apparatus further comprises:
and the second neglecting module is used for disregarding the sliding operation in response to the direction of the sliding operation being the third direction or the fourth direction.
In some embodiments, the display module is configured to respond to a sliding operation in a block editing area, and the block is in a running state, and perform the step of displaying, in the block running display area, that the virtual object continues to move at a second movement speed indicated by the sliding operation.
In some embodiments, the display module is further configured to respond to a sliding operation in the tile editing area, and the tile is in an unoperated state, and display that a tile selected by the sliding operation moves along with a direction and a distance of the sliding operation.
In some embodiments, the display module is further configured to perform at least one of:
displaying a second running speed indicated by the running speed adjustment operation in a program block editing area;
and in the program block operation display area, updating the motion speed of the displayed virtual object to the second motion speed.
In one aspect, a terminal is provided that includes one or more processors and one or more memories having at least one computer program stored therein that is loaded and executed by the one or more processors to implement various alternative implementations of the block-execution method described above.
In one aspect, a computer readable storage medium having stored therein at least one computer program loaded and executed by a processor to implement various alternative implementations of the block execution method described above is provided.
In one aspect, a computer program product or computer program is provided, the computer program product or computer program comprising one or more program codes, the one or more program codes being stored in a computer readable storage medium. The one or more processors of the terminal read the one or more program codes from the computer-readable storage medium, the one or more processors executing the one or more program codes, such that the terminal performs the program block running method of any one of the possible embodiments described above.
According to the program block operation mode, the operation speed adjusting function is provided, when the program block is operated, the operation speed of the program block can be changed through the operation of adjusting the operation speed of the program block, and then the program block is displayed through the change of the movement speed of the virtual object, so that the flexible and efficient program block debugging process is realized, for example, whether the movement of the virtual object is problematic or not is observed by adjusting the operation speed slowly, and therefore the position of an error program block is accurately determined without debugging the program block one by one. For example, when the program block runs smoothly, the running speed is adjusted to be faster, and the debugging process of the program block is completed rapidly, so that the method effectively improves the debugging efficiency of the program block.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings are also obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment of a block execution method according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for running a program block according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for running a program block according to an embodiment of the present application;
fig. 4 is a schematic diagram of a terminal interface provided in an embodiment of the present application;
fig. 5 is a schematic diagram of a terminal interface provided in an embodiment of the present application;
fig. 6 is a schematic diagram of a terminal interface provided in an embodiment of the present application;
fig. 7 is a schematic diagram of a terminal interface provided in an embodiment of the present application;
fig. 8 is a schematic diagram of a terminal interface provided in an embodiment of the present application;
fig. 9 is a schematic diagram of a terminal interface provided in an embodiment of the present application;
FIG. 10 is a flowchart of a method for running a program block according to an embodiment of the present application;
Fig. 11 is a schematic diagram of a terminal interface provided in an embodiment of the present application;
FIG. 12 is a flowchart of a method for running a program block according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a block running device according to an embodiment of the present application;
fig. 14 is a block diagram of a terminal according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The terms "first," "second," and the like in this application are used to distinguish between identical or similar items that have substantially the same function and function, and it should be understood that there is no logical or chronological dependency between the "first," "second," and "nth" terms, nor is it limited to the number or order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element. For example, the first image is referred to as a second image, and similarly, the second image is referred to as a first image without departing from the scope of the various examples. The first image and the second image are both images and, in some cases, separate and distinct images.
The term "at least one" in this application means one or more, the term "plurality" in this application means two or more, for example, a plurality of data packets means two or more.
It should also be understood that, in the embodiments of the present application, the sequence number of each process does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not constitute any limitation on the implementation process of the embodiments of the present application.
It should also be understood that determining B from a does not mean determining B from a alone, but also determining B from a and/or other information.
It should also be understood that the term "if" may be interpreted to mean "when" ("white" or "upon") or "in response to a determination" or "in response to detection". Similarly, the phrase "if a [ stated condition or event ] is detected" may be interpreted to mean "upon a determination" or "in response to a determination" or "upon a detection of a [ stated condition or event ] or" in response to a detection of a [ stated condition or event ], depending on the context.
Virtual environment: is a virtual environment that an application displays (or provides) while running on a terminal. The virtual environment may be a simulation environment for the real world, a semi-simulation and semi-fictional virtual environment, or a pure fictional virtual environment. The virtual environment may be any one of a two-dimensional virtual environment, a 2.5-dimensional virtual environment, or a three-dimensional virtual environment, and the dimensions of the virtual environment are not limited in the embodiments of the present application. For example, the virtual environment may include sky, land, sea, etc., the land may include environmental elements of a desert, city, etc., and the user may control the virtual object to move in the virtual environment.
Virtual object: refers to an object in a virtual environment, which is a fictitious object for simulating a real object or living being. For example, characters, animals, plants, oil drums, walls, stones, snow flakes, etc. displayed in the virtual environment. The virtual objects include virtual objects and virtual roles, wherein the virtual objects are objects of inanimate nature, e.g., virtual buildings, virtual vehicles, virtual props, etc. A virtual character refers to an object having a life attribute, for example, a virtual object may be a virtual character, a virtual animal, or the like.
Optionally, the virtual objects include movable virtual objects and non-movable virtual objects. Such as movable virtual vehicles, movable virtual objects, non-movable virtual buildings, etc.
The following describes the environment in which the present application is implemented.
Fig. 1 is a schematic diagram of an implementation environment of a block operation method according to an embodiment of the present application. The implementation environment includes a terminal 101 or the implementation environment includes a terminal 101 and a block execution platform 102. The terminal 101 is connected to the block execution platform 102 through a wireless network or a wired network.
The terminal 101 is at least one of a smart phone, a game console, a desktop computer, a tablet computer, an electronic book reader, an MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert compression standard audio plane 3) player or an MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert compression standard audio plane 4) player, a laptop portable computer, and an intelligent robot. The terminal 101 installs and runs an application program supporting the running of program blocks, for example, a system application, a programming application, or the like. Of course, the application program can also be an instant messaging application, a news pushing application, a shopping application, an online video application and a social application, wherein the programming function is embedded in the application program.
The terminal 101 has a programming function and a function of running a program, for example. The terminal 101 performs this independently and also provides data services to it through the block execution platform 102. The embodiments of the present application are not limited in this regard.
The chunk running platform 102 includes at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. The block execution platform 102 is used to provide background services for applications that support block execution. Optionally, the block execution platform 102 takes over primary processing work and the terminal 101 takes over secondary processing work; alternatively, the block execution platform 102 takes on secondary processing work and the terminal 101 takes on primary processing work; alternatively, the block execution platform 102 or the terminal 101 separately undertakes processing work, respectively. Alternatively, the block execution platform 102 and the terminal 101 perform cooperative computing by using a distributed computing architecture.
Optionally, the block running platform 102 includes at least one server 1021 and a database 1022, where the database 1022 is used to store data, and in this embodiment of the present application, the database 1022 stores blocks, a set of blocks obtained by splicing blocks, or a virtual scene, a virtual object model, or an action animation corresponding to the block running, which provides a data service for the at least one server 1021.
The server is an independent physical server, is a server cluster or a distributed system formed by a plurality of physical servers, and is a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms and the like. The terminal is a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
Those skilled in the art will recognize that the number of the terminals 101 and the servers 1021 is greater or smaller. For example, the number of the terminals 101 and the servers 1021 is only one, or the number of the terminals 101 and the servers 1021 is tens or hundreds, or more, the number of the terminals or the servers and the device types are not limited in the embodiment of the present application.
Fig. 2 is a flowchart of a block operation method provided in an embodiment of the present application, and referring to fig. 2, the method includes the following steps.
201. The terminal obtains a program block for controlling the movement of the virtual object.
In the embodiment of the present application, some program codes are packaged as a whole into a block, which is a program block. Any executable code and data may be encapsulated in the program blocks. By packaging the program codes into blocks and splicing different program blocks, the effect of writing the codes can be completed.
Visually, the splice of blocks is somewhat similar to a building block splice, and thus, the blocks described above may be visually referred to as building blocks, and thus, an understanding of the blocks may be: and the code is packaged into building blocks in graphical programming, and the user drags the building blocks to splice, so that the effect of coding can be achieved.
The graphical programming refers to a mode of packaging programming language in graphical building blocks, dragging the building blocks to build, and completing programming. The graphical programming mode can be applied to programming learning of teenagers or beginners, and the teenagers or beginners are educated in a simple, visual and acceptable mode to quickly and easily master programming knowledge, so that the method is beneficial to popularization of programming education.
The graphical programming mode can be applied to mobile terminal programming products, and the mobile terminal programming products have good application prospects because of the advantages of convenience in carrying, wide application scenes, easiness in sharing and spreading and the like.
In order to better reflect the running effect of the program blocks, the terminal visualizes the running effect of the program blocks by controlling the movement of the virtual objects, wherein the movement mode of the virtual objects is related to the encapsulation of the program codes in the program blocks. For example, program code encapsulated in a block is an instruction to control the progress of a virtual object, and the block is used to control the progress of the virtual object.
202. And the terminal responds to the running instruction of the program block, and the virtual object is displayed to move according to the first movement speed in the program block running display area.
After the program blocks are spliced to finish programming, whether the running condition of the program blocks meets the expectations or not and whether the program blocks run or not can cause problems are observed through the running of the program blocks.
When a user wants to run a program block, the user can perform a running operation on the program block, and the terminal responds to a running instruction triggered by the running operation to execute program codes in the program block. The program block is used for controlling the virtual object, and when the program code in the program block is operated, the terminal controls the virtual object to move according to the instruction indicated by the program code. The terminal may display the motion of the virtual object in the block execution presentation area to show the execution effect of the program code.
When the running speeds of the program blocks are different, the movement speeds of the virtual objects are different when the movement of the virtual objects is controlled. In this step 202, the terminal controls the virtual object to move at a first movement speed.
203. And the terminal responds to the operation speed adjusting operation of the program block, and in the program block operation display area, the virtual object is displayed to continue to move according to a second movement speed, wherein the second movement speed is different from the first movement speed.
In the embodiment of the application, a manner of adjusting the running speed of the program block is provided initially, in which the running speed of the program block is adjusted, and naturally, when the program block is run, the running speed of the virtual object is correspondingly changed when the virtual object is controlled to run. As can be appreciated, when the running speed of the program block is high, the movement speed of the virtual object is relatively high; when the running speed of the program block is low, the movement speed of the virtual object is relatively low. In this step 203, the running speed of the program block is adjusted, and the movement speed of the virtual object is changed from the first movement speed to the second movement speed.
According to the program block operation mode, the operation speed adjusting function is provided, when the program block is operated, the operation speed of the program block can be changed through the operation of adjusting the operation speed of the program block, and then the program block is displayed through the change of the movement speed of the virtual object, so that the flexible and efficient program block debugging process is realized, for example, whether the movement of the virtual object is problematic or not is observed by adjusting the operation speed slowly, and therefore the position of an error program block is accurately determined without debugging the program block one by one. For example, when the program block runs smoothly, the running speed is adjusted to be faster, and the debugging process of the program block is completed rapidly, so that the method effectively improves the debugging efficiency of the program block.
Fig. 3 is a flowchart of a block operation method provided in an embodiment of the present application, and referring to fig. 3, the method includes the following steps.
301. The terminal obtains a program block for controlling the movement of the virtual object.
In the embodiment of the application, the program code is packaged in blocks, and program codes for realizing different functions can be packaged in different blocks. For example, a program block has further program code encapsulated therein before the virtual object is controlled. The other program block is encapsulated with program code that controls the virtual object to the left one step. The other block has encapsulated therein program code that controls the virtual object to step right. The other program block is encapsulated with program code for controlling the virtual object to go back. The functionality of a block is illustrated here, and program code implementing other functions, such as controlling virtual object jumping, or controlling virtual object running from one location to another, etc., may be encapsulated in the block. The embodiments of the present application are not limited in this regard.
By encapsulating the program codes into different blocks, a motion control mode of the virtual object can be obtained through the program blocks, and different program blocks are spliced according to different sequences, so that different motion control can be completed.
In some embodiments, the terminal may provide different modes of blocks, each of which may be encapsulated with a different block. For example, in mode one, the terminal may be provided with three blocks of program code that respectively encapsulate program code that controls the virtual object to go forward, go up and turn left. The user may combine the three blocks arbitrarily, e.g., acquire the previous further block, rank one upward block, rank two forward blocks, rank one left turn block, …, and rank one upward block. For another example, in mode two, the terminal may be provided with five blocks that respectively encapsulate blocks that control the virtual object to run, walk, speak, rotate, and squat. The user may also arbitrarily combine the five blocks.
In some embodiments, the terminal may provide different virtual environments, which correspond to different motion control tasks. The terminal may display any virtual environment in the block operation presentation area in response to a selection instruction of the virtual environment, and may display a path of movement required by the virtual object in the virtual environment. The user can know how to splice program blocks by seeing the virtual environment, so that the virtual object moves along the path in the virtual environment to complete the corresponding motion control task of the virtual environment. The motion control task can be regarded as a checkpoint, different virtual environments correspond to different checkpoints, and a user can control the virtual object to complete the checkpoint by splicing program blocks to run the program blocks. By setting the checkpoints in different virtual environments, a user is guided to know the splicing method of the program blocks, so that the purpose of programming education is achieved.
The number of blocks in step 301 may be one or more, that is, the terminal may acquire at least one block. The number of the program blocks can be set by a related technician or can be set by a user according to the current virtual scene. For example, in one particular embodiment, as shown in FIG. 4, a terminal may display at least one candidate virtual environment 401 in a virtual environment selection interface 400 in response to programming instructions. In fig. 4, only three candidate virtual environments 401 are illustrated as a map, and thus three candidate virtual environments may be: map 1, map 2, and map 3. In the embodiment of the application, each candidate virtual scene is used for guiding the user to learn different programming knowledge, for example, map 1 is used for guiding the user to learn a conditional statement, and map 2 and map 3 are used for guiding the user to learn to sequentially execute.
The terminal may, in response to a selected operation on any of the candidate virtual environments 401, jump the interface to a motion control task selection interface 500 as shown in fig. 5, where at least one motion control task 501 may be displayed in the motion control task selection interface 500. The terminal may jump the interface to a motion control editing interface 600 as shown in fig. 6 in response to a selected operation of any motion control task 501, where the motion control editing interface 600 may include a plurality of regions: a task information area 601, a block preset area 602, a block edit area 603, and a block run presentation area 604.
The task information area 601 is used for displaying task information, which may be referred to as a checkpoint information area, and the task information may be referred to as checkpoint information. For example, the task information including the task progress block may also be referred to as a building block, and thus the block preset area 602 may also be referred to as a building block preset area. The block preset area 602 refers to an area in which preset blocks are displayed. The block preset area 602 displays a preset block. Program code implementing different functions is encapsulated in different program blocks. For example, in fig. 6, 3 preset building blocks are shown in the block preset area 602: the 3 building blocks are respectively encapsulated with program codes for controlling the virtual object to go forward one step, go upward one step and turn left. The block edit area 603 may be referred to as a block edit area. The block editing area 603 refers to an area in which blocks are edited to obtain a block sequence to be run. The editing process performed on the block in this block editing area 603 is a programming process. Specifically, the user may drag a desired program block from the program block preset area 602 into the program block editing area 603, and arbitrarily edit the running sequence of each program block in the program block editing area 603, to finally obtain a program block sequence to be run. It should be noted that, the blocks in the preset area of the blocks are not dragged during the editing process, but are realized by copying one and the same block and dragging the copied block. The blocks in the block preset area are reusable. For example, the user selects a block from the block preset area 602 to drag into the block editing area 603 and drag to a certain position, and the terminal may display that the block is dragged into the block editing area 603 along with the drag operation. The blocks in the block preset area 602 are not reduced by copying a block having the same function and adding the block in the block edit area 603, and determining the position of the block in the block sequence by the end point of the drag operation. The user can also select any one of the blocks in the block edit area 603 to arbitrarily change the arrangement order of the blocks in the block sequence. The terminal may also display the sequence number of each block in the block sequence at the corresponding position of the block in the block edit area 603. In fig. 6, 8 blocks are dragged by the user into the block edit area 603, and the sequence is arranged, and the serial number of each block is displayed on the left side of the block. The first block is the block of the previous step. The second block is the block of the last step. The following blocks of 3-8 are the blocks of the previous step, the left turn, the previous step, and the previous step, respectively. The user can arbitrarily edit the program blocks according to the virtual environment, so that the virtual object moves in the virtual environment to complete the motion control task set by the virtual environment. The block run presentation area 604 is used to display the motion of virtual objects and thus may also be referred to as a stage area. The block running presentation area refers to an area in which the block running condition is presented by controlling virtual objects in the virtual environment. When the program block runs, the terminal correspondingly controls the virtual object to move according to the program code packaged by the program block. If the block sequence in the block edit area of fig. 6 is run, the terminal will display the virtual object in the block run presentation area 604 on the right side in the previous step, then go to the last step, then go on going to the first two steps again, then turn left, go on going to the first step after turning left, last two steps upwards.
302. And the terminal responds to the running instruction of the program block, and in the program block running display area, the virtual object is displayed to move according to a first running speed corresponding to the first running speed, wherein the first running speed refers to the running speed of the program block.
After the program blocks are spliced, if the operation effect of the spliced program blocks is to be checked, a user can perform operation, and the terminal can execute the program blocks after receiving an operation instruction triggered by the operation. When the program block is executed, the execution effect of the program block can be visualized, and the motion condition of the virtual object is displayed in the program block operation display area, so that the user can adjust the program block according to the real operation condition, and the user can be guided to adjust the program block sequence for completing the task quickly.
In some embodiments, a default operation speed may be set when the program block is operated, for example, the default operation speed may be a first operation speed, and accordingly, the operation speed of the program block corresponds to a movement speed of the virtual object, the first operation speed corresponds to a first movement speed, and the terminal may control the first virtual object to move according to the first movement speed. The default running speed may be set by a related technician according to requirements, or may be set by a user according to own usage habits, which is not limited in the embodiment of the present application.
In other embodiments, before the program block is executed, the user may set the first running speed through a running speed setting operation, and the terminal may control the virtual object to move at a first movement speed corresponding to the first running speed. The running speed setting mode may be various modes, for example, a running speed adjustment control may be displayed in the program block running display area, where the running speed adjustment control includes at least two running speeds, and a user may select any one of the running speeds as the first running speed.
In a specific possible embodiment, the at least two operating speeds may be displayed in the form of a double speed, for example, the at least two operating speeds may be displayed as four times speeds of 0.5, 1, 2, and 3, that is, a default operating speed s may be set in the terminal, and if the user selects 0.5 times speed, the operating speed of the program block is 0.5 x s. If the user selects 2 times speed, the running speed of the program block is 2 x s, and s is a positive number.
For example, in one particular example, as shown in fig. 6, a terminal may display a run control 605 in a block run presentation area 600. The execution control 605 is shown in fig. 6 by way of example only in the lower right corner of the block execution presentation area 600, and the execution control 605 may be displayed in other positions, which is not limited in the embodiment of the present application. After setting the blocks or sequences of blocks in the block edit area 603, the user may click on the run control 605, and the terminal may then run the blocks in the block edit area 603. Specifically, if the block edit area 603 includes a block sequence therein, the terminal may sequentially execute the respective blocks in the order of the respective blocks in the block sequence. As shown in fig. 7, the program block is in an on-running state, and the terminal may display the state of the running control 605 as the on-running state, where the running control 605 in the on-running state is used to suspend the running process of the program block, and thus, the running control 605 in the on-running state may also be referred to as a suspension control.
For this running speed adjustment control, as shown in fig. 7, the running speed adjustment control 701 may be displayed in the lower left corner region of the virtual object presentation area in the block running presentation area 600, which is only an example herein, and the running speed adjustment control 701 may also be displayed in other positions, for example, in the lower right corner region or other regions of the block editing area, which is not limited in the embodiments of the present application. The operational speed adjustment control 701 includes a plurality of selectable multiplier speeds 702 therein, such that the presently selected multiplier speed is 1. The speed 1 display style is different from other selectable speed display styles to highlight that the currently selected speed is 1.
For another example, a setting control may be displayed in the program block operation display area, the user may perform a triggering operation on the setting control, the terminal receives a setting instruction triggered by the triggering operation, and a setting interface is displayed, where the user may set an initial operation speed at will. The terminal takes the set operation speed as a first operation speed.
In some embodiments, considering that the running speed of the program block is displayed in the moving speed of the virtual object, the terminal may also display the moving speed of the virtual object, so that the user sees the displayed moving speed, knows the running speed of the current program block, and may also adjust the moving speed to the moving speed wanted by the user based on the moving speed if the user wants to adjust the running speed. For example, as shown in fig. 7, the movement speed of the virtual object may be displayed by a movement speed display control 703. As shown in fig. 7, the running speed of the currently set program block is 1 time speed, and the movement speed display control 703 can be correspondingly displayed as 1 time speed. It should be noted that, the running speed of the program block is synchronous with the movement speed of the virtual object, and once one of them changes, the other changes synchronously.
In a specific possible embodiment, the motion speed display control 703 may be a triggerable control, and the user may trigger the motion speed display control 703 to trigger and adjust the motion speed of the virtual object. For example, in the above manner of providing at least two running speeds, at least two moving speeds, such as four times of 0.5, 1, 2, 3, are correspondingly provided. If the user clicks the movement speed display control 703, the terminal may adjust the movement speed of the virtual object to a movement speed adjacent to the first movement speed. The first movement speed is the movement speed of the current virtual object. For example, the current movement speed display control 703 is displayed at 1 speed, and if the user clicks on this "x1", the movement speed of the virtual object can be adjusted to 2 speed. Accordingly, the movement speed display control 703 is displayed as "x2". The selected double speed is also adjusted to 2 times speed in the operation speed adjustment control 701.
The movement speed of the virtual object is associated with the running speed of the program block, and the movement speed of the virtual object, that is, the running speed of the program block, is changed. Through the motion speed display control, a mode of changing the motion speed of the virtual object to adjust the running speed of the program block is provided, the motion of the virtual object is directly displayed in the interface, the motion speed of the virtual object is adjusted intuitively, the motion speed is adjusted more can meet the actual requirements of users, the adjustment mode is more intuitive, various and flexible adjustment modes are provided for the running speed adjustment, and the user can select a proper mode to adjust the running speed according to own habits. In addition, through setting at least two movement speeds, a user can adjust the movement speed through simple clicking operation, other controls or jump interfaces are not required to be unfolded, shielding can not be generated on the movement condition of the current virtual object, each adjustment can be adjusted to be the movement speed adjacent to the current movement speed in the preset movement speeds, the movement speed can not be greatly adjusted at one time, the situation that the movement speed cannot be accurately adjusted to a proper speed at one time due to the large adjustment is avoided, the adjustment process is relatively stable, and the operation difficulty and frequency are reduced.
In response to the operation instruction for the block, the step 302 is to display, in the block operation display area, a process in which the virtual object moves according to the first movement speed, where the process is described by taking determining the first movement speed of the virtual object through the first operation speed of the block as an example, in some embodiments, the terminal may directly establish a correspondence between the operation speed of the block and the first movement speed of the virtual object without determining the operation speed of the block, and when adjusting the operation speed of the block, the terminal directly adjusts the operation according to the operation speed, and determines the movement speed of the virtual object, so as to control the virtual object to move according to the movement speed.
303. The terminal detects an operation speed adjustment operation for the block.
When the program block is running, if the user wants to adjust the running speed of the program block, the running speed adjusting operation may be performed. The operation speed adjusting operation may include a plurality of operation modes, and two operation modes are provided below, the terminal may provide either one of the two operation modes, or may provide both operation modes,
operation mode one, sliding operation in the program block editing area.
Accordingly, steps 304 and 305, that is, in response to the sliding operation in the pair of block editing areas, display the virtual object to continue moving at the second movement speed indicated by the sliding operation in the block operation display area.
In the first operation mode, the terminal may detect a sliding event occurring in the block editing area during the running of the block, and determine whether and how to adjust the running speed according to the sliding event. For example, the sliding operation may be an up-and-down sliding operation, for example, up-sliding may make the running speed smaller and down-sliding may make the running speed larger. Of course, the sliding operation may be a left-right sliding operation, which is not limited in the embodiment of the present application.
And the second operation mode is the clicking operation of the operation speed adjusting control.
The second operation manner, that is, the clicking operation of the operation speed adjustment control described in the above step 302, is not described in detail herein. Accordingly, in response to the clicking operation of the pair of operation speed adjustment controls, in the block operation display area, the virtual object is displayed to continue to move at a second movement speed, where the second movement speed corresponds to the second operation speed selected by the clicking operation.
The foregoing provides only two possible modes of operation, and in some embodiments, the foregoing operation speed adjustment operation may be implemented by other modes of operation. For example, the running speed adjustment operation may be a gesture operation. For example, a camera may be provided on the terminal, and image acquisition is performed on gesture operations by the camera, and a gesture in the gesture operations is determined by the acquired image, so as to execute a running speed adjustment process corresponding to the gesture. For another example, the gesture operation may be performed by a camera and tracking (tracking) system to recognize the gesture, and the embodiment of the present application does not limit how to detect the gesture operation specifically.
304. The terminal responds to the operation speed adjusting operation of the program block, and determines a second operation speed of the program block according to the first operation speed.
After detecting the operation speed adjusting operation, the terminal can determine how to adjust the operation speed of the program block according to the operation speed adjusting operation. Wherein the first operating speed and the second operating speed are different, that is, the operating speed of the program block is changed by the operating speed adjusting operation.
In some embodiments, when the operation modes of the operation speed adjustment operation are different, the process of determining the second operation speed by the terminal according to the first operation speed may also be different. The manner of determining the second operation speed in the two operation manners in step 303 is described below.
In the first operation mode, the terminal may determine the second operation speed according to any one of a displacement, a speed, or an acceleration of a sliding operation in the block editing area, and the first operation speed in response to the sliding operation.
In one aspect, the block editing area is used to detect an editing operation in an editing block stage, and display a block editing process and an edited block sequence according to the editing operation. In the running stage of the program blocks, the program block sequences are running, and cannot be edited any more, otherwise, the program block running is easy to cause problems. Thus, in the block running phase, the block editing area does not respond to the editing operation of the user. In consideration of this, another function can be set for the block editing area, and the other function is to detect the operation speed adjustment operation at the block operation stage to adjust the operation speed of the block, so that the adjustment of the operation speed of the block does not need to divide a new area to support the operation of the block, and the high reuse of the block editing area can be realized, so that the interface display is simpler, the block operation display area can be larger, and the user can clearly see the block operation condition.
On the other hand, since the sliding operation may include sliding operations in different directions, the operation speed adjusting operation is set to be a sliding operation, and an increase operation speed or a decrease operation speed is determined by an operation direction, for example, sliding in one direction to increase the operation speed, and sliding in the opposite direction to decrease the operation speed, so that a more flexible operation speed adjustment can be realized, and the sliding operation device accords with an operation habit of a user, is simple and convenient to operate, has a higher acceptance degree of the user, has a lower operation cost, and effectively improves the operation efficiency.
The method provided by the application can be applied to a mobile terminal graphical programming tool, the program block is called a building block, and the interactive mode for adjusting the running speed of the building block is set in the building block editing area (namely the program block editing area) when the building block runs, so that a user can adjust the running speed in real time in the running process of the building block code, and the user can check the running effect of the building block and check the accuracy of the building block code according to the running speed required by the user, thereby greatly improving the efficiency and convenience of the debugging of the building block. The interaction mode is realized through the sliding operation, single-hand operation can be supported, the operation cost is reduced, and more controllable operation experience is provided for people with hand function deficiency (such as handicapped people or end users with poor operation). The method can be applied to building block operation scenes of mobile terminal IDE (Integrated Development Environment ) and building block operation scenes of desktop computer equipment, and the embodiment of the application is not limited to the above.
Wherein the sliding operation is an operation at an arbitrary position within the block editing area. The block editing area displays a running block sequence, and in the block running stage, the terminal detects a sliding operation in the block editing area and does not edit the block sequence, and the stage defaults to failing to edit the block. That is, the user may perform a sliding operation on a position where the block sequence is displayed in the block editing area, or may perform a sliding operation on a position where the block sequence is not displayed. In the block running phase, the terminal detects a sliding operation in the block editing area, and defaults to not an editing operation on the block but to determine whether it is a running speed adjustment operation.
The sliding direction of the sliding operation for adjusting the running speed may be set by a related technician according to the requirement, or may be set by a user according to the use habit of the user, which is not limited in the embodiment of the present application. For example, the running speed can be adjusted by a left-right sliding operation. For another example, the running speed may be adjusted by a slide up and down operation.
In some embodiments, a threshold value may be provided by which it is determined whether the current running speed adjustment operation is a malfunction. Specifically, the terminal may obtain any one of a displacement, a speed, or an acceleration of the sliding operation in response to the sliding operation in the block editing area, and determine the second operation speed according to the first operation speed in response to the magnitude of any one of the displacement, the speed, or the acceleration of the sliding operation being greater than a threshold. It will be appreciated that if the magnitude of any one of the displacement, velocity or acceleration of the sliding operation is greater than the threshold value, it is indicated that the magnitude of the operation by the user is relatively large or relatively rapid, and that the user intentionally operates on the screen to change the running speed, and thus the terminal can determine how the running speed is changed according to the sliding operation.
Wherein the displacement of the sliding operation is used to indicate a change in the position of the contact of the sliding operation. The displacement refers to a directed line segment from the start point of the sliding operation to the end point of the sliding operation. Speed or acceleration. The speed of the sliding operation is used for the speed and direction of the contact movement of the sliding operation. The speed of the sliding operation refers to the ratio of the displacement of the sliding operation to the duration. The acceleration of the sliding operation is used to indicate how fast the contact movement speed of the sliding operation changes. The acceleration is the ratio of the change in speed during the sliding operation to the time it takes for this change to occur. In some embodiments, the acceleration may be a maximum acceleration during a sliding operation.
In this manner, the terminal may also ignore the sliding operation in response to any one of the displacement, velocity, or acceleration of the sliding operation being less than or equal to the threshold. The ignoring of the sliding operation may mean that no motion control corresponding to the sliding operation is performed, for example, if it is determined that the sliding operation is valid, the terminal adjusts the running speed of the program block, and adjusts the moving speed of the virtual object. If it is determined that the sliding operation is ignored, the terminal does not need to adjust the running speed of the program block and the movement speed of the virtual object. It will be appreciated that if the displacement, speed or acceleration of the sliding operation is less than the threshold value, indicating that the user has a small or slow magnitude, it is possible that the user simply carelessly hits the screen, is an erroneous operation, and is not an operation for changing the running speed, and thus the terminal can ignore the sliding operation. Through the setting of the threshold value, unstable running speed of the program block caused by misoperation of a user is effectively avoided, and the program block is continuously changed.
For the above-described process of determining the second running speed according to any one of the displacement, the speed, or the acceleration of the sliding operation, any one of the displacement, the speed, or the acceleration of the sliding operation may be a vector having a direction and a magnitude. Judging whether the operation speed is the operation speed adjustment operation of the user according to the displacement, speed or acceleration of the sliding operation; depending on the direction of the sliding operation, different running speed adjustment modes can be provided. It is considered that the running speed may be increased or decreased because the running speed may be increased or decreased by setting the sliding direction differently.
The above process of determining the second running speed according to any one of the displacement, the speed or the acceleration of the sliding operation may be determined by a related technician according to the requirement, which item is specifically adopted to determine the second running speed, or may be set by the user according to the use habit of the user, which is not limited in the embodiment of the present application.
In some embodiments, the terminal determines the second operating speed based on a displacement of the sliding operation. Accordingly, the terminal can respond to the sliding operation in the program block editing area, acquire the displacement of the sliding operation, and respond to the fact that the displacement is larger than a threshold value, and determine the second operation speed according to the first operation speed. The terminal may also ignore the sliding operation in response to the magnitude of the displacement being less than or equal to a threshold.
The process of obtaining the displacement of the sliding operation may be: the terminal acquires a starting point and an ending point of the sliding operation, and determines a directed line segment pointing from the starting point to the ending point as a displacement of the sliding operation.
In a specific possible embodiment, the start point and the end point may be represented by coordinates in the terminal screen. The terminal may acquire a first coordinate at the start of the sliding operation and a second coordinate at the end of the sliding operation, and then determine a directed line segment between the two coordinates as a displacement of the sliding operation.
In other embodiments, the terminal determines the second operating speed based on the speed of the sliding operation. Accordingly, the terminal can respond to the sliding operation in the program block editing area, acquire the speed of the sliding operation, and respond to the speed being greater than a threshold value, and determine the second running speed according to the first running speed. The terminal may also ignore the sliding operation in response to the magnitude of the velocity being less than or equal to a threshold.
The process of obtaining the speed of the sliding operation may be: the terminal acquires the displacement and the duration of the sliding operation, and then takes the ratio of the displacement to the duration as the speed of the sliding operation. The process of obtaining the displacement is explained in the foregoing, and will not be repeated here.
In other embodiments, the terminal determines the second operating speed based on an acceleration of the sliding operation. Accordingly, the terminal can respond to the sliding operation in the program block editing area, acquire the acceleration of the sliding operation, and respond to the acceleration being greater than a threshold value, and determine the second running speed according to the first running speed. The terminal may also ignore the sliding operation in response to the magnitude of the acceleration being less than or equal to a threshold value.
The process of acquiring the acceleration of the sliding operation may be: the terminal acquires the speed at each moment in the sliding operation process, then determines the acceleration at each moment according to the speed at each moment, and then determines the maximum value as the acceleration of the sliding operation.
In some embodiments, at least two operating speeds may be provided, the at least two operating speeds being preset operating speeds. The at least two operating speeds are mutually unequal. The at least two operating speeds may be understood as a plurality of levels of operating speeds, different levels of operating speeds. In a specific possible embodiment, the at least two operating speeds may include a base operating speed, the base operating speed being 1 times the speed, the other operating speeds being named by a ratio to the base operating speed. The at least two operating speeds may be displayed in the form of a double speed, for example, the at least two operating speeds may be displayed as four double speeds of 0.5, 1, 2, 3, that is, a basic operating speed s may be provided in the terminal, and if the operating speed is determined to be 0.5 double speed, the actual operating speed of the program block is 0.5 x s. If the user selects 2 times speed, the actual running speed of the program block is 2 x s, and s is a positive number. The different speed doubles is the different levels. For example, at least two operating speeds are shown as four times 0.5, 1, 2, 3, and it is understood that there are four levels of operating speeds, the first level corresponding to 0.5 times, the second level corresponding to 1 time, the third level corresponding to 2 times, and the fourth level corresponding to 3 times.
In these embodiments, the adjustment process of the operation speed may be provided with: each slide may be used to change one level, taking the level adjacent to the current level as the adjusted running speed. The terminal may determine an operation speed adjacent to the first operation speed, which corresponds to the direction, of the at least two operation speeds as the second operation speed according to the direction of the sliding operation.
Specifically, the terminal determines an operation speed which is larger than and adjacent to the first operation speed from at least two operation speeds as the second operation speed in response to the direction of the sliding operation being a first direction; and the terminal responds to the second direction of the sliding operation, and determines the running speed which is smaller than the first running speed and is adjacent to the first running speed from at least two running speeds as the second running speed.
Wherein the first direction and the second direction may be opposite directions. In some embodiments, the first direction and the second direction may be two opposite directions in a vertical direction, and the sliding operation is an up-and-down sliding operation. For example, the first direction is vertically downward and the second direction is vertically upward. For another example, the first direction is vertically upward and the second direction is vertically downward. In other embodiments, the first direction and the second direction may be two opposite directions in the horizontal direction, and the sliding operation is a left-right sliding operation. For example, the first direction is horizontal to the left and the second direction is horizontal to the right. For another example, the first direction is horizontal to the right and the second direction is horizontal to the left.
In some embodiments, the magnitude of the direction of the sliding operation and any of the displacement, velocity, or acceleration of the sliding operation may be the magnitude of the component of the direction of the sliding operation and any of the displacement, velocity, or acceleration of the sliding operation in the first direction or the second direction. Accordingly, the terminal may further ignore the sliding operation in response to the direction of the sliding operation being the third direction or the fourth direction.
The third direction and the fourth direction may be two opposite directions in the vertical direction or two opposite directions in the horizontal direction. Wherein the third direction and the fourth direction may be perpendicular to the first direction and the second direction, respectively. In this way, when an effective sliding operation is an up-and-down sliding operation, it is not effective if a certain sliding operation is a left-and-right sliding operation. In this way, when an effective sliding operation is a left-right sliding operation, it is not effective if a certain sliding operation is an up-down sliding operation.
Through standardizing the effective sliding operation direction, whether the sliding operation intention is to adjust the running speed or not can be determined according to the actual sliding operation of a user, so that the situation that the running speed of a program block is changed due to misoperation of the user can be effectively avoided, and the user needs to adjust the program block to be adjusted to the proper running speed.
For example, the first direction is vertically downward and the second direction is vertically upward. For another example, the first direction is vertically upward and the second direction is vertically downward. For another example, the first direction is horizontal to the left and the second direction is horizontal to the right. For another example, the first direction is horizontal to the right and the second direction is horizontal to the left. Accordingly, if the first and second directions are vertical directions, the third and fourth directions may be horizontal directions. If the first and second directions are horizontal directions, the third and fourth directions may be vertical directions.
For example, the sliding operation may be an up-and-down sliding operation, taking a first direction as a vertically downward direction and a second direction as a vertically upward direction as an example, with the up-and-down sliding for decreasing the running speed and the down-sliding for increasing the running speed. If the user slides left and right, the terminal may ignore the sliding operation. Taking the case of determining the second running speed by the displacement of the sliding operation as an example, as shown in fig. 8 (a), the first running speed of the program block is 1-fold speed and the first running speed of the virtual object is also 1-fold speed before the adjustment. The user slides down the screen in the block editing area, and as shown in fig. 8 (b), the terminal may set the running speed of the block to 2 times speed, and adjust the first moving speed of the virtual object to "2 times speed" of the second moving speed, that is, automatically adjust the double speed to the adjacent increasing double speed (2 times speed) of the current double speed (1 times speed). As another example, as shown in fig. 9 (a), the first running speed of the block is 1-time speed and the first moving speed of the virtual object is also 1-time speed before the adjustment. The user slides up the screen in the block editing area, as shown in fig. 9 (b), the terminal may set the running speed of the block to 0.5-fold speed, adjust the first moving speed of the virtual object to the second moving speed "0.5-fold speed", that is, automatically adjust the double speed to the adjacent decreasing double speed (0.5-fold speed) of the current double speed (1-fold speed). Of course, the first direction and the second direction may be set by a related technician according to the needs, which is not limited in the embodiments of the present application.
The program blocks are called building blocks herein, and the function of adjusting the running speed is provided in the building block editing area creatively according to the requirement of adjusting the running speed when the building blocks are run. The user can freely adjust the running speed of the building blocks according to personal habits and needs through an interactive mode of sliding in the building block editing area. In the running process of the building blocks, a user can directly adjust the running speed of the building blocks in real time through gesture sliding in the editing area of the building blocks, so that the problem building blocks can be more accurately searched for and modified. The user slows down and accelerates the running speed of building blocks respectively through upper and lower sliding building block editing areas, accords with the operation cognition of the user under the scene, and reduces the operation threshold for debugging the running speed of the building blocks.
In one specific example, as shown in fig. 10, when a user touches the screen, a touch_start event is triggered, at which point the start coordinates of the finger touch; the user moves the finger; the user's finger leaves the screen, trigger touch_end event, calculate the displacement vector of the initial coordinate and end coordinate of finger at this moment; then, the component of the displacement vector in the vertical direction can be obtained, the upward component is positive, the downward component is negative, and of course, the absolute value of the displacement can also be directly calculated, and the direction is further judged. A symmetrical threshold range of negative to positive values (e.g., -30 to 30) may then be taken, i.e., the threshold is 30 in this example. If it is less than the minimum value (the absolute value of the component is greater than the threshold value), the current speed drops by one step; if it is greater than the maximum value (the absolute value of the component is greater than the threshold), the current speed is increased by one step. If the operation range is within the threshold range (the absolute value of the component is smaller than or equal to the threshold), the operation amplitude of the user is smaller, the speed adjustment is not triggered, and the current running speed is kept.
In some embodiments, both the acceleration and deceleration are performed at a limited number of levels of speed, with no deceleration occurring if the lowest speed has been reached, and no acceleration occurring if the highest speed has been reached. That is, the terminal responds to the first operation speed being the maximum of at least two operation speeds, and the operation speed adjustment operation is for increasing the first operation speed, ignoring the operation speed adjustment operation. Or, the terminal responds to the first operation speed as the minimum value of at least two operation speeds, and the operation speed adjusting operation is used for reducing the first operation speed, and the operation speed adjusting operation is ignored. The at least two operating speeds may be preset operating speeds of different sizes, which encompasses an adjustable range of operating speeds, by means of which the operating speed of the program block can be well adjusted. When the extreme value of the adjustable range of the running speed is reached, if the running speed is readjusted, the adjustable range is exceeded, the running speed may become extremely small or extremely large, at this time, the running speed of the virtual object may be extremely small or extremely large, the running condition of the program block may not be clearly seen by the extremely large user, the wrong program block may not be better positioned, and the running time of the program block may be greatly prolonged due to the extremely small running speed, so that the running efficiency of the program block is affected. Therefore, through the arrangement, the running efficiency of the program blocks can be ensured, and the user can be ensured to clearly know the running condition of the program blocks.
In other embodiments, the terminal may determine the running speed adjustment value corresponding to the direction according to the direction of the sliding operation and the magnitude of any one of the displacement, the speed or the acceleration of the sliding operation, and the absolute value of the running speed adjustment value is positively related to the magnitude of any one of the displacement, the speed or the acceleration of the sliding operation. The terminal may determine a second operating speed based on the first operating speed and the operating speed adjustment value.
In these embodiments, several operation speeds need not be preset for selection, and the terminal may directly determine the second operation speed according to the adjustment formula of the operation speed.
The running speed adjustment value may be positive or negative. The absolute value of the running speed adjustment value may be determined according to the magnitude of any one of the displacement, the speed, or the acceleration of the sliding operation, for example, the terminal may determine the absolute value of the running speed adjustment value according to the displacement of the sliding operation. The absolute value of the running speed adjustment value is positively correlated with the magnitude of the displacement of the sliding operation. The larger the magnitude (absolute value) of the displacement, the larger the absolute value of the running speed adjustment value. The smaller the magnitude (absolute value) of the displacement, the smaller the absolute value of the running speed adjustment value. Or the terminal may determine the absolute value of the running speed adjustment value according to the speed of the sliding operation. Or the terminal may determine the absolute value of the running speed adjustment value according to the acceleration of the sliding operation.
Through the positive correlation setting, a user can realize different operation speed adjustment modes through one operation. For example, the user may want to adjust the running speed from a relatively large value to a relatively small value by sliding a relatively long distance when performing a sliding operation, so that multiple operations are not required when the running speed needs to be greatly adjusted, the number of operations is reduced, and the adjustment efficiency is improved. For another example, the user may want to slightly adjust the running speed from a relatively large value to a small value by sliding a relatively short distance when performing a sliding operation. The adjustment of the running speed is finer, and a user can accurately adjust the running speed according to the self requirement to find out a more suitable running speed.
The positive and negative of the running speed adjustment value may be determined according to the direction of the sliding operation. In some embodiments, the direction of the sliding operation is a first direction, and the terminal may determine that the running speed adjustment value is a positive number; the direction of the sliding operation is the second direction, and the terminal may determine that the running speed adjustment value is negative. The first direction and the second direction are set in the same manner as the above, for example, the first direction is vertically downward, and the second direction is vertically upward. For another example, the first direction is vertically upward and the second direction is vertically downward. For another example, the first direction is horizontal to the left and the second direction is horizontal to the right. For another example, the first direction is horizontal to the right and the second direction is horizontal to the left. The arrangement of the first direction and the second direction in the embodiment of the present application is not particularly limited.
Similarly, the displacement, speed or acceleration of the sliding operation in this manner may be a component in the first direction or the second direction as the magnitude thereof, which will not be described herein. For example, when determining the running speed adjustment value based on the displacement of the sliding operation, the terminal may acquire the component size of the sliding operation in the first direction or the second direction, and determine the absolute value of the running speed adjustment value according to the component size. The absolute value is positively correlated with the component size.
The step 304 is a step of responding to the sliding operation in the block editing area, and executing the movement of the virtual object in the block operation display area according to the second movement speed indicated by the sliding operation when the block is in the operation state. The running state of the program block refers to a state in which the program block is operated and the program block is not yet operated. The block edit field is responsive to a sliding event while the block is in an active state. The block may not support the editing operation of the block at this time when the terminal is still running, and when a sliding event in the editing area of the block is detected, it may be determined whether the sliding event is used to adjust the running speed, so the terminal may execute the step 304, determine the second running speed according to the first running speed, and execute the subsequent motion control step for the virtual object.
In another case, that is, when a sliding operation is detected on a block editing area for editing a block, the block is in an unoperated state. Specifically, the terminal may respond to the sliding operation in the block editing area, and the block is in an unoperated state, and display that the block selected by the sliding operation moves along with the direction and distance of the sliding operation. The program block is in a non-running state, which is a state that the program block has not been run yet or has been run to end, and the program block is not running at the current moment. The block is not yet running, and thus the user may not have edited the block, and thus the current sliding operation on the editing area of the block may be an editing operation on the block, and the terminal may determine the block controlled by the sliding operation and control the block to move along with the sliding operation.
The block editing area has different functions at different stages of the block. The method is used for detecting the editing operation in the editing program block stage and displaying the program block editing process and the edited program block sequence according to the editing operation. In the running stage of the program blocks, the program block sequences are running, and cannot be edited any more, otherwise, the program block running is easy to cause problems. Thus, in the block running phase, the block editing area does not respond to the editing operation of the user. In consideration of this, another function can be set for the block editing area, and the other function is to detect the operation speed adjustment operation at the block operation stage to adjust the operation speed of the block, so that the adjustment of the operation speed of the block does not need to divide a new area to support the operation of the block, and the high reuse of the block editing area can be realized, so that the interface display is simpler, the block operation display area can be larger, and the user can clearly see the block operation condition.
In the second operation mode, the terminal may respond to the clicking operation of the operation speed adjustment control, obtain the second operation speed selected by the clicking operation, and determine the second movement speed corresponding to the second operation speed. The second running speed refers to the running speed of the adjusted program block. The second movement speed refers to the movement speed of the adjusted virtual object. Before adjustment, the running speed of the program block is the first running speed, and the movement speed of the virtual object is the first movement speed.
At least two operation speeds are displayed in the operation speed adjustment control for selection by a user, any one of the operation speeds can be selected by the user, and the terminal can be adjusted according to the selection of the user. For example, in one specific example, as shown in fig. 11 (a), the first running speed of the program block is 1-time speed before the adjustment, and accordingly, the first moving speed of the virtual object is 1-time speed. As shown in fig. 11 (b), when the user selects 2 times of the speed in the operation speed adjustment control, the second operation speed of the program block is 2 times of the speed, and accordingly, the second movement speed of the virtual object is 2 times of the speed.
In a specific possible embodiment, as shown in fig. 12, in the second operation mode, when a click event trigger is detected, the terminal may adjust the operation speed value corresponding to the button, that is, the terminal may adjust the operation speed to a selected value in the operation speed adjustment control. The click event triggering can use basic button click event monitoring processing, and the corresponding running rate value is changed in callback logic of event processing.
305. And the terminal displays the virtual object to continue to move according to the second movement speed corresponding to the second operation speed in the program block operation display area.
The terminal determines a second running speed, the running speed of the program block and the running speed of the virtual object have a corresponding relation, and the running speed of the program block are consistent in change. That is, the second operation speed corresponds to the second movement speed, and the movement speed of the virtual object becomes the second movement speed.
The steps 304 and 305 are to display the process of continuing the motion of the virtual object at the second motion speed in the block operation presentation area in response to the operation speed adjustment operation on the block. Wherein the second movement speed is different from the first movement speed. In the running process of the program blocks, a user can randomly adjust the running speed to meet the debugging requirements of the user. For example, if the user has a great grasp on the programming result, the running speed can be increased, so as to shorten the running time and improve the debugging efficiency of the program block. If the user does not know the programming result, the running speed can be reduced a little, so that the execution effect of the program blocks can be seen slowly, and when a certain program block runs abnormally, the user can accurately position the program block without debugging the program block one by one.
In some embodiments, the terminal may further update the motion speed of the displayed virtual object to the second motion speed in the block running presentation area. As shown in (b) of fig. 8, the movement speed shown in the lower right corner becomes "2". As shown in (b) of fig. 9, the movement speed shown in the lower right corner becomes "0.5". As shown in (b) of fig. 11, the movement speed shown in the lower right corner becomes "2".
In some embodiments, the terminal may further display a second operation speed indicated by the operation speed adjustment operation in the block editing area. For example, as shown in fig. 8 (b), the terminal may display the adjusted second operation speed "x2"801 in the block editing area. As shown in fig. 9 (b), the terminal may display the adjusted second operation speed "x0.5"901 in the block editing area. It should be noted that "x2"801 and "x0.5"901 shown in fig. 8 and 9 may be floating in the block editing area according to a certain transparency, and may overlap with the block sequence displayed in the block editing area when displayed, and the "x2"801 and "x0.5"901 in fig. 8 and 9 are not blocked by the block, but are displayed together with the block sequence in order to show the pattern in which "x2"801 and "x0.5"901 are displayed, and the display thereof does not affect the display of the original block sequence.
According to the program block operation mode, the operation speed adjusting function is provided, when the program block is operated, the operation speed of the program block can be changed through the operation of adjusting the operation speed of the program block, and then the program block is displayed through the change of the movement speed of the virtual object, so that the flexible and efficient program block debugging process is realized, for example, whether the movement of the virtual object is problematic or not is observed by adjusting the operation speed slowly, and therefore the position of an error program block is accurately determined without debugging the program block one by one. For example, when the program block runs smoothly, the running speed is adjusted to be faster, and the debugging process of the program block is completed rapidly, so that the method effectively improves the debugging efficiency of the program block.
All the above optional solutions are combined arbitrarily to form an optional embodiment of the present application, and are not described herein in detail.
Fig. 13 is a schematic structural diagram of a block running apparatus according to an embodiment of the present application, referring to fig. 13, the apparatus includes:
an acquiring module 1301, configured to acquire a program block, where the program block is used to control the motion of the virtual object;
A display module 1302, configured to respond to an operation instruction for the program block, and display, in a program block operation display area, that a virtual object moves according to a first movement speed;
the display module 1302 is further configured to display, in the chunk operation display area, that the virtual object continues to move at a second movement speed in response to the operation speed adjustment operation on the chunk, where the second movement speed is different from the first movement speed.
In some embodiments, the display module 1302 is configured to respond to an operation instruction for the program block, and display, in the program block operation display area, that the virtual object moves at a first movement speed corresponding to a first operation speed, where the first operation speed is the operation speed of the program block.
In some embodiments, the display module 1302 includes a determination unit and a display unit;
the determining unit is used for responding to the operation speed adjusting operation of the program block, and determining a second operation speed of the program block according to the first operation speed;
and the display unit is used for displaying the virtual object to continue to move according to the second movement speed corresponding to the second operation speed in the program block operation display area.
In some embodiments, the display module 1302 is configured to perform any of the following:
responding to the sliding operation in the program block editing area, and displaying the virtual object to continue to move according to the second movement speed indicated by the sliding operation in the program block operation display area;
and responding to clicking operation of the operation speed adjustment control, and displaying the virtual object to continue to move according to a second movement speed in the program block operation display area, wherein the second movement speed corresponds to a second operation speed selected by the clicking operation.
In some embodiments, the determining unit is configured to determine, in response to a sliding operation in the block editing area, a second running speed according to any one of a displacement, a speed, or an acceleration of the sliding operation, and the first running speed;
in some embodiments, the display unit is configured to display, in the block running display area, that the virtual object continues to move at a second movement speed corresponding to the second running speed.
In some embodiments, the determining unit includes an acquisition subunit and a determining subunit;
the acquisition subunit is used for responding to the sliding operation in the program block editing area and acquiring any one of displacement, speed or acceleration of the sliding operation;
The determination subunit is configured to determine a second operating speed from the first operating speed in response to a magnitude of any one of a displacement, a speed, or an acceleration of the sliding operation being greater than a threshold.
In some embodiments, the determining subunit is configured to determine, as the second operation speed, an operation speed adjacent to the first operation speed corresponding to the direction of the sliding operation, from among at least two operation speeds.
In some embodiments, the determining unit is configured to:
determining an operation speed adjusting value corresponding to the direction according to the direction of the sliding operation and the magnitude of any one of displacement, speed or acceleration of the sliding operation, wherein the absolute value of the operation speed adjusting value is positively related to the magnitude of any one of the displacement, speed or acceleration;
and determining a second operating speed according to the first operating speed and the operating speed adjustment value.
In some embodiments, the apparatus further comprises:
and a first ignoring module configured to ignore the sliding operation in response to a magnitude of any one of a displacement, a velocity, or an acceleration of the sliding operation being less than or equal to the threshold.
In some embodiments, the magnitude of any one of the displacement, velocity, or acceleration of the sliding operation is the magnitude of a component of the any one in the first direction or the second direction;
The apparatus further comprises:
and a second ignoring module configured to ignore the sliding operation in response to the direction of the sliding operation being the third direction or the fourth direction.
In some embodiments, the display module 1302 is configured to perform the step of displaying, in the chunk running presentation area, that the virtual object continues to move at the second movement speed indicated by the sliding operation in response to the sliding operation in the chunk editing area and the chunk is in a running state.
In some embodiments, the display module 1302 is further configured to display, in response to a sliding operation in the tile editing area, that the tile is in an unoperated state, that the tile selected by the sliding operation moves along with the direction and distance of the sliding operation.
In some embodiments, the display module 1302 is further configured to perform at least one of:
displaying a second running speed indicated by the running speed adjustment operation in the program block editing area;
and in the program block operation display area, updating the motion speed of the displayed virtual object to the second motion speed.
The device provided by the embodiment of the application provides a program block operation function with adjustable operation speed, and provides an operation speed adjustment function, when the program block is operated, the operation speed of the program block can be changed through the operation speed adjustment operation of the program block, and then the operation speed of the program block is changed to be displayed through the change of the motion speed of the virtual object, so that the flexible and efficient program block debugging process is realized, for example, the operation speed is adjusted to be slow to observe whether the motion of the virtual object is problematic, and therefore the position of an error program block is accurately determined, and the debugging is not needed one by one. For example, when the program block runs smoothly, the running speed is adjusted to be faster, and the debugging process of the program block is completed rapidly, so that the method effectively improves the debugging efficiency of the program block.
It should be noted that: the block operation device provided in the above embodiment only illustrates the division of the above functional modules when the block is operated, and in practical application, the above functional allocation is performed by different functional modules according to needs, that is, the internal structure of the block operation device is divided into different functional modules to complete all or part of the functions described above. In addition, the block operation device and the block operation method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the block operation device and the block operation method are detailed in the method embodiments, which are not repeated herein.
Fig. 14 is a block diagram of a terminal according to an embodiment of the present application. The terminal 1400 may be a portable mobile terminal such as: a smart phone, a tablet, an MP3 (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook or a desktop. Terminal 1400 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal, and the like.
In general, terminal 1400 includes: a processor 1401 and a memory 1402.
Processor 1401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1401 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 1401 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1401 may be integrated with a GPU (Graphics Processing Unit, image processor) for taking care of rendering and rendering of content that the display screen is required to display. In some embodiments, the processor 1401 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 1402 may include one or more computer-readable storage media, which may be non-transitory. Memory 1402 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1402 is used to store at least one instruction for execution by processor 1401 to implement the block execution methods provided by the method embodiments in the present application.
In some embodiments, terminal 1400 may optionally further include: a peripheral interface 1403 and at least one peripheral. The processor 1401, memory 1402, and peripheral interface 1403 may be connected by a bus or signal lines. The individual peripheral devices may be connected to the peripheral device interface 1403 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1404, a display screen 1405, a camera assembly 1406, audio circuitry 1407, and a power source 1409.
Peripheral interface 1403 may be used to connect at least one Input/Output (I/O) related peripheral to processor 1401 and memory 1402. In some embodiments, processor 1401, memory 1402, and peripheral interface 1403 are integrated on the same chip or circuit board; in some other embodiments, either or both of processor 1401, memory 1402, and peripheral interface 1403 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 1404 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1404 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 1404 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1404 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuit 1404 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the world wide web, metropolitan area networks, intranets, generation mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuit 1404 may also include NFC (Near Field Communication, short range wireless communication) related circuits, which are not limited in this application.
The display screen 1405 is used to display UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 1405 is a touch display screen, the display screen 1405 also has the ability to collect touch signals at or above the surface of the display screen 1405. The touch signal may be input to the processor 1401 as a control signal for processing. At this time, the display 1405 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 1405 may be one, disposed on the front panel of the terminal 1400; in other embodiments, the display 1405 may be at least two, respectively disposed on different surfaces of the terminal 1400 or in a folded design; in other embodiments, the display 1405 may be a flexible display disposed on a curved surface or a folded surface of the terminal 1400. Even more, the display 1405 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The display 1405 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera component 1406 is used to capture images or video. Optionally, camera assembly 1406 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 1406 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuitry 1407 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 1401 for processing, or inputting the electric signals to the radio frequency circuit 1404 for voice communication. For purposes of stereo acquisition or noise reduction, a plurality of microphones may be provided at different portions of the terminal 1400, respectively. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 1401 or the radio frequency circuit 1404 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuitry 1407 may also include a headphone jack.
A power supply 1409 is used to power the various components in terminal 1400. The power supply 1409 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1409 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 1400 also includes one or more sensors 1410. The one or more sensors 1410 include, but are not limited to: acceleration sensor 1411, gyro sensor 1412, pressure sensor 1413, optical sensor 1415, and proximity sensor 1416.
The acceleration sensor 1411 may detect the magnitudes of accelerations on three coordinate axes of a coordinate system established with the terminal 1400. For example, the acceleration sensor 1411 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 1401 may control the display screen 1405 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 1411. The acceleration sensor 1411 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 1412 may detect a body direction and a rotation angle of the terminal 1400, and the gyro sensor 1412 may collect a 3D motion of the user to the terminal 1400 in cooperation with the acceleration sensor 1411. The processor 1401 may implement the following functions based on the data collected by the gyro sensor 1412: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
Pressure sensor 1413 may be disposed on a side frame of terminal 1400 and/or on an underside of display 1405. When the pressure sensor 1413 is provided at a side frame of the terminal 1400, a grip signal of the terminal 1400 by a user can be detected, and the processor 1401 performs right-and-left hand recognition or quick operation according to the grip signal collected by the pressure sensor 1413. When the pressure sensor 1413 is disposed at the lower layer of the display screen 1405, the processor 1401 realizes control of the operability control on the UI interface according to the pressure operation of the user on the display screen 1405. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The optical sensor 1415 is used to collect the ambient light intensity. In one embodiment, processor 1401 may control the display brightness of display screen 1405 based on the intensity of ambient light collected by optical sensor 1415. Specifically, when the intensity of the ambient light is high, the display luminance of the display screen 1405 is turned high; when the ambient light intensity is low, the display luminance of the display screen 1405 is turned down. In another embodiment, the processor 1401 may also dynamically adjust the shooting parameters of the camera assembly 1406 based on the ambient light intensity collected by the optical sensor 1415.
A proximity sensor 1416, also referred to as a distance sensor, is typically provided on the front panel of terminal 1400. The proximity sensor 1416 is used to collect the distance between the user and the front of the terminal 1400. In one embodiment, when proximity sensor 1416 detects a gradual decrease in the distance between the user and the front of terminal 1400, processor 1401 controls display 1405 to switch from the on-screen state to the off-screen state; when the proximity sensor 1416 detects that the distance between the user and the front surface of the terminal 1400 gradually increases, the processor 1401 controls the display 1405 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 14 is not limiting and that terminal 1400 may include more or less components than those illustrated, or may combine certain components, or employ a different arrangement of components.
In an exemplary embodiment, a computer readable storage medium, e.g. a memory, comprising at least one computer program executable by a processor to perform the block execution method of the above embodiments is also provided. For example, the computer readable storage medium is Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), read-Only optical disk (Compact Disc Read-Only Memory, CD-ROM), magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising one or more program codes, the one or more program codes being stored in a computer readable storage medium. The one or more processors of the terminal read the one or more program codes from the computer-readable storage medium, the one or more processors executing the one or more program codes to cause the terminal to perform the above-described program block operation method.
In some embodiments, the computer program related to the embodiments of the present application may be deployed to be executed on one terminal or on a plurality of terminals located at one site, or alternatively, on a plurality of terminals distributed at a plurality of sites and interconnected by a communication network, and a plurality of terminals distributed at a plurality of sites and interconnected by a communication network may constitute a blockchain system.
Those of ordinary skill in the art will appreciate that all or a portion of the steps implementing the above-described embodiments are implemented by hardware, and also by a program for instructing the relevant hardware to implement, the program being stored in a computer readable storage medium, the above-mentioned storage medium being a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description is only of alternative embodiments of the present application and is not intended to limit the present application, but any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (22)

1. A method of program block execution, the method comprising:
acquiring a program block, wherein the program block is used for controlling the movement of a virtual object;
responding to an operation instruction of the program block, and displaying a virtual object to move according to a first movement speed in a program block operation display area;
responding to a sliding operation in a program block editing area, wherein the program block is in an operating state, and displaying the virtual object to continue to move according to a second movement speed indicated by the sliding operation in the program block operation display area, wherein the second movement speed is different from the first movement speed;
and responding to the sliding operation in the program block editing area, and displaying that the program block selected by the sliding operation moves along with the direction and the distance of the sliding operation when the program block is in an unoperated state.
2. The method of claim 1, wherein the displaying the virtual object in the block run presentation area in response to the run instruction to the block comprises:
Responding to an operation instruction of the program block, and displaying that a virtual object moves according to a first movement speed corresponding to a first operation speed in a program block operation display area, wherein the first operation speed refers to the operation speed of the program block;
the method further comprises the steps of:
determining a second operating speed of the program block according to the first operating speed in response to an operating speed adjustment operation on the program block;
and in the program block operation display area, displaying the virtual object to continue to move according to a second movement speed corresponding to the second operation speed.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and responding to clicking operation of the operation speed adjustment control, and displaying the virtual object to continue to move according to a second movement speed in the program block operation display area, wherein the second movement speed corresponds to a second operation speed selected by the clicking operation.
4. The method of claim 1, wherein the displaying, in the chunk running presentation area, the virtual object to continue moving at a second movement speed indicated by the sliding operation in response to the sliding operation in the chunk editing area, comprises:
In response to a sliding operation in the program block editing area, determining a second running speed according to any one of displacement, speed or acceleration of the sliding operation and the first running speed;
and in the program block operation display area, displaying the virtual object to continue to move according to a second movement speed corresponding to the second operation speed.
5. The method of claim 4, wherein the determining a second operating speed in response to a sliding operation within a block editing area from any one of a displacement, a speed, or an acceleration of the sliding operation, and the first operating speed, comprises:
in response to a sliding operation in a program block editing area, acquiring any one of displacement, speed or acceleration of the sliding operation;
in response to the magnitude of any one of the displacement, velocity, or acceleration of the sliding operation being greater than a threshold, a second operating speed is determined from the first operating speed.
6. The method of claim 5, wherein determining a second operating speed from the first operating speed comprises:
and determining an operation speed adjacent to the first operation speed corresponding to the direction in at least two operation speeds as the second operation speed according to the direction of the sliding operation.
7. The method of claim 5, wherein determining a second operating speed from the first operating speed comprises:
determining an operation speed adjusting value corresponding to the direction according to the direction of the sliding operation and the magnitude of any one of displacement, speed or acceleration of the sliding operation, wherein the absolute value of the operation speed adjusting value is positively related to the magnitude of any one of the displacement, speed or acceleration;
and determining a second operation speed according to the first operation speed and the operation speed adjustment value.
8. The method of claim 5, wherein the method further comprises:
in response to the magnitude of any one of the displacement, velocity, or acceleration of the sliding operation being less than or equal to the threshold value, the sliding operation is ignored.
9. The method of claim 5, wherein the magnitude of any one of the displacement, velocity, or acceleration of the sliding operation is the magnitude of a component of the any one in the first direction or the second direction;
the method further comprises the steps of:
and ignoring the sliding operation in response to the direction of the sliding operation being the third direction or the fourth direction.
10. The method of claim 1 or 2, wherein in response to the operation of adjusting the speed of execution of the program block, displaying, in the program block execution presentation area, that the virtual object continues to move at the second speed of movement, further comprising at least one of:
displaying a second running speed indicated by the running speed adjustment operation in a program block editing area;
and in the program block operation display area, updating the motion speed of the displayed virtual object to the second motion speed.
11. A block execution device, the device comprising:
the acquisition module is used for acquiring a program block, wherein the program block is used for controlling the movement of the virtual object;
the display module is used for responding to the running instruction of the program block and displaying the virtual object to move according to the first movement speed in the program block running display area;
the display module is further used for responding to sliding operation in a program block editing area, the program block is in an operation state, and in the program block operation display area, the virtual object is displayed to continue to move according to a second movement speed indicated by the sliding operation, and the second movement speed is different from the first movement speed; and responding to the sliding operation in the program block editing area, and displaying that the program block selected by the sliding operation moves along with the direction and the distance of the sliding operation when the program block is in an unoperated state.
12. The apparatus of claim 11, wherein the displaying the virtual object in the block operation presentation area in response to the operation instruction to the block comprises:
responding to an operation instruction of the program block, and displaying that a virtual object moves according to a first movement speed corresponding to a first operation speed in a program block operation display area, wherein the first operation speed refers to the operation speed of the program block;
and in response to the operation speed adjustment operation on the program block, displaying that the virtual object continues to move according to the second movement speed in the program block operation display area, including:
determining a second operating speed of the program block according to the first operating speed in response to an operating speed adjustment operation on the program block;
and in the program block operation display area, displaying the virtual object to continue to move according to a second movement speed corresponding to the second operation speed.
13. The apparatus according to claim 11 or 12, characterized in that the apparatus further comprises:
and responding to clicking operation of the operation speed adjustment control, and displaying the virtual object to continue to move according to a second movement speed in the program block operation display area, wherein the second movement speed corresponds to a second operation speed selected by the clicking operation.
14. The apparatus of claim 11, wherein the apparatus further comprises:
in response to a sliding operation in the program block editing area, determining a second running speed according to any one of displacement, speed or acceleration of the sliding operation and the first running speed;
and in the program block operation display area, displaying the virtual object to continue to move according to a second movement speed corresponding to the second operation speed.
15. The apparatus of claim 14, wherein the determining, in response to a sliding operation within a block editing region, a second operating speed from any one of a displacement, a speed, or an acceleration of the sliding operation, and the first operating speed, comprises:
in response to a sliding operation in a program block editing area, acquiring any one of displacement, speed or acceleration of the sliding operation;
in response to the magnitude of any one of the displacement, velocity, or acceleration of the sliding operation being greater than a threshold, a second operating speed is determined from the first operating speed.
16. The apparatus of claim 15, wherein said determining a second operating speed from said first operating speed comprises:
And determining an operation speed adjacent to the first operation speed corresponding to the direction in at least two operation speeds as the second operation speed according to the direction of the sliding operation.
17. The apparatus of claim 15, wherein said determining a second operating speed from said first operating speed comprises:
determining an operation speed adjusting value corresponding to the direction according to the direction of the sliding operation and the magnitude of any one of displacement, speed or acceleration of the sliding operation, wherein the absolute value of the operation speed adjusting value is positively related to the magnitude of any one of the displacement, speed or acceleration;
and determining a second operation speed according to the first operation speed and the operation speed adjustment value.
18. The apparatus of claim 15, wherein the apparatus further comprises:
in response to the magnitude of any one of the displacement, velocity, or acceleration of the sliding operation being less than or equal to the threshold value, the sliding operation is ignored.
19. The apparatus of claim 15, wherein a magnitude of any one of a displacement, a velocity, or an acceleration of the sliding operation is a component magnitude of the any one in the first direction or the second direction;
The apparatus further comprises:
and ignoring the sliding operation in response to the direction of the sliding operation being the third direction or the fourth direction.
20. The apparatus of claim 11 or 12, wherein in response to the operation of adjusting the speed of operation of the program block, in the program block operation display area, displaying that the virtual object continues to move at the second movement speed, further comprising at least one of:
displaying a second running speed indicated by the running speed adjustment operation in a program block editing area;
and in the program block operation display area, updating the motion speed of the displayed virtual object to the second motion speed.
21. A terminal comprising one or more processors and one or more memories, the one or more memories having stored therein at least one computer program loaded and executed by the one or more processors to implement the block-running method of any of claims 1-10.
22. A computer readable storage medium having stored therein at least one computer program loaded and executed by a processor to implement the block running method of any one of claims 1 to 10.
CN202110469087.7A 2021-04-28 2021-04-28 Program block running method, device, equipment and storage medium Active CN113094282B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110469087.7A CN113094282B (en) 2021-04-28 2021-04-28 Program block running method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110469087.7A CN113094282B (en) 2021-04-28 2021-04-28 Program block running method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113094282A CN113094282A (en) 2021-07-09
CN113094282B true CN113094282B (en) 2023-08-01

Family

ID=76680867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110469087.7A Active CN113094282B (en) 2021-04-28 2021-04-28 Program block running method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113094282B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239089A (en) * 2014-06-26 2014-12-24 北京奇虎科技有限公司 Game speed change implementing method and game speed change implementing device
CN105045520A (en) * 2015-08-31 2015-11-11 网易(杭州)网络有限公司 Touch screen response method and apparatus
JP2016175175A (en) * 2015-03-19 2016-10-06 株式会社デンソーウェーブ Robot operation device, and robot operation program
CN106178505A (en) * 2016-07-29 2016-12-07 成都伟嘉斯特科技有限公司 A kind of graphical child programs toy and method thereof
CN108514740A (en) * 2018-04-04 2018-09-11 网易(杭州)网络有限公司 Virtual objects velocity mode method of adjustment and device, electronic equipment, storage medium
CN108553892A (en) * 2018-04-28 2018-09-21 网易(杭州)网络有限公司 virtual object control method, device, storage medium and electronic equipment
CN108594746A (en) * 2018-03-21 2018-09-28 珠海优特电力科技股份有限公司 Visual programming control system and method, apparatus
CN109316745A (en) * 2018-10-12 2019-02-12 网易(杭州)网络有限公司 Virtual objects motion control method and device, electronic equipment, storage medium
CN109739497A (en) * 2018-12-06 2019-05-10 深圳市中农网有限公司 Page development method, apparatus, computer equipment and storage medium
CN109814875A (en) * 2017-12-12 2019-05-28 上海葡萄纬度科技有限公司 Program the method and system reversely programmed, the equipment, medium of toy
CN110262378A (en) * 2019-07-02 2019-09-20 张艳五 A method of online programming is realized using APP control robot
WO2019206814A1 (en) * 2018-04-24 2019-10-31 Kinematics Gmbh System for programming
CN111309229A (en) * 2020-02-17 2020-06-19 Oppo广东移动通信有限公司 Parameter adjusting method, device, terminal and storage medium
CN112035110A (en) * 2020-08-28 2020-12-04 腾讯科技(深圳)有限公司 Parameter adjusting method, device, client and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040031019A1 (en) * 2002-05-20 2004-02-12 Richard Lamanna Debugger for a graphical programming environment
US20140047413A1 (en) * 2012-08-09 2014-02-13 Modit, Inc. Developing, Modifying, and Using Applications
CN110494843B (en) * 2017-04-03 2023-10-10 创首公司 Mixed mode programming
CN108509139B (en) * 2018-03-30 2019-09-10 腾讯科技(深圳)有限公司 Control method for movement, device, electronic device and the storage medium of virtual objects
CN109107155B (en) * 2018-08-08 2019-12-10 腾讯科技(深圳)有限公司 Virtual article adjusting method, device, terminal and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239089A (en) * 2014-06-26 2014-12-24 北京奇虎科技有限公司 Game speed change implementing method and game speed change implementing device
JP2016175175A (en) * 2015-03-19 2016-10-06 株式会社デンソーウェーブ Robot operation device, and robot operation program
CN105045520A (en) * 2015-08-31 2015-11-11 网易(杭州)网络有限公司 Touch screen response method and apparatus
CN106178505A (en) * 2016-07-29 2016-12-07 成都伟嘉斯特科技有限公司 A kind of graphical child programs toy and method thereof
CN109814875A (en) * 2017-12-12 2019-05-28 上海葡萄纬度科技有限公司 Program the method and system reversely programmed, the equipment, medium of toy
CN108594746A (en) * 2018-03-21 2018-09-28 珠海优特电力科技股份有限公司 Visual programming control system and method, apparatus
CN108514740A (en) * 2018-04-04 2018-09-11 网易(杭州)网络有限公司 Virtual objects velocity mode method of adjustment and device, electronic equipment, storage medium
WO2019206814A1 (en) * 2018-04-24 2019-10-31 Kinematics Gmbh System for programming
CN108553892A (en) * 2018-04-28 2018-09-21 网易(杭州)网络有限公司 virtual object control method, device, storage medium and electronic equipment
CN109316745A (en) * 2018-10-12 2019-02-12 网易(杭州)网络有限公司 Virtual objects motion control method and device, electronic equipment, storage medium
CN109739497A (en) * 2018-12-06 2019-05-10 深圳市中农网有限公司 Page development method, apparatus, computer equipment and storage medium
CN110262378A (en) * 2019-07-02 2019-09-20 张艳五 A method of online programming is realized using APP control robot
CN111309229A (en) * 2020-02-17 2020-06-19 Oppo广东移动通信有限公司 Parameter adjusting method, device, terminal and storage medium
CN112035110A (en) * 2020-08-28 2020-12-04 腾讯科技(深圳)有限公司 Parameter adjusting method, device, client and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
【哈哈!ScratchJr~】3小猫逛街;ScratchJr;《https://www.kidscoding8.com/111532.html》;1-2页 *
ScratchJr.【哈哈!ScratchJr~】3小猫逛街.《https://www.kidscoding8.com/111532.html》.1-2页. *

Also Published As

Publication number Publication date
CN113094282A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
US11565181B2 (en) Virtual object control method and apparatus, computer device, and storage medium
KR102688646B1 (en) Systems, methods, and graphical user interfaces for interacting with augmented and virtual reality environments
JP7109553B2 (en) Additional object display method and its device, computer device and storage medium
CN111240673B (en) Interactive graphic work generation method, device, terminal and storage medium
KR102491443B1 (en) Display adaptation method and apparatus for application, device, and storage medium
KR102479052B1 (en) Method for controlling display of electronic device using a plurality of controllers and device thereof
CN111701238A (en) Virtual picture volume display method, device, equipment and storage medium
CN108694073B (en) Control method, device and equipment of virtual scene and storage medium
CN108268187A (en) The display methods and device of intelligent terminal
KR20200098034A (en) Electronic device for providing augmented reality user interface and operating method thereof
US11954200B2 (en) Control information processing method and apparatus, electronic device, and storage medium
CN112044065B (en) Virtual resource display method, device, equipment and storage medium
US11782571B2 (en) Device, method, and graphical user interface for manipulating 3D objects on a 2D screen
CN107803030B (en) Refreshing method and device for resource site on virtual map
CN112230907B (en) Program generation method, device, terminal and storage medium
CN111589125A (en) Virtual object control method and device, computer equipment and storage medium
CN112764654B (en) Component adsorption operation method and device, terminal and storage medium
CN110928464A (en) User interface display method, device, equipment and medium
CN112230910B (en) Page generation method, device and equipment of embedded program and storage medium
US12061773B2 (en) Method and apparatus for determining selected target, device, and storage medium
CN109032492B (en) Song cutting method and device
CN113094282B (en) Program block running method, device, equipment and storage medium
CN113242466B (en) Video editing method, device, terminal and storage medium
KR102719257B1 (en) Method and device for drifting a virtual vehicle in a virtual world, and storage medium
CN112230906B (en) Method, device and equipment for creating list control and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant