Information processing methods and apparatus, electronic devices, storage media
By controlling the direction of virtual objects in response to sliding operations in racing games, the problem of inconvenient operation in existing technologies has been solved, and a more intuitive and convenient steering control experience has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2026-03-13
AI Technical Summary
In existing racing games, when players control the virtual vehicle's steering by clicking the direction button or tilting their phone, the operation is inconvenient and it is not intuitive to link the control with the steering action. Especially when going through corners, players need to keep clicking or keeping their phones tilted, which affects the player experience.
By responding to swipe operations on the touch screen of a terminal device, the steering of the target virtual object is controlled according to the swipe trajectory, including determining the steering direction and angle, and using the vector offset direction and angle of the swipe operation to achieve the steering of the virtual object.
It provides a more intuitive and convenient steering control experience, reduces operational complexity, and enhances the fun and convenience of user interaction.
Smart Images

Figure CN114618162B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to information processing methods and apparatus, electronic devices, and storage media. Background Technology
[0002] With the development of internet technology, more and more games are being used on mobile devices. Generally, games can be categorized as: racing games, shooting games, strategy games, action games, role-playing games, music games, etc.
[0003] The most popular racing games are various racing games, where players control virtual vehicles to steer and move. In these games, players control steering by tapping directional buttons or tilting their phones. When using directional buttons, each tap of the left turn button turns the virtual vehicle a specified angle to the left. When navigating sharp curves, players need to continuously tap the corresponding turn button, making it difficult to intuitively link steering controls with the vehicle's movement, causing significant inconvenience. Similarly, when tilting the phone to control steering, players must maintain a constant tilt when cornering, making it difficult to observe the phone screen.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] In view of the above problems, this application is made to provide an information processing method and apparatus, electronic device, and storage medium that overcomes or at least partially solves the above problems, including:
[0006] An information processing method involves executing an application on a processor of a terminal device and rendering a graphical user interface (GUI) on a touchscreen display of the terminal device, the GUI containing at least a moving target virtual object; the method includes:
[0007] In response to a swipe operation on the graphical user interface, the target virtual object is controlled to turn according to the movement trajectory of the swipe operation on the graphical user interface.
[0008] Optionally, in response to a swipe operation on the graphical user interface, the target virtual object is controlled to turn according to the movement trajectory of the swipe operation on the graphical user interface.
[0009] Optionally, controlling the direction of the target virtual object based on the movement trajectory after the sliding operation meets preset conditions includes:
[0010] The target virtual object is controlled to turn based on the movement trajectory after the offset in the first direction reaches a preset offset based on the sliding operation.
[0011] Optionally, controlling the direction of the target virtual object based on the movement trajectory of the sliding operation in the graphical user interface includes:
[0012] Based on the vector offset direction and vector offset angle of the movement trajectory, determine the turning direction and turning angle of the target virtual object;
[0013] The target virtual object is steered according to the steering direction and steering angle.
[0014] Optionally, determining the turning direction and turning angle of the target virtual object based on the vector offset direction and vector offset angle of the movement trajectory includes:
[0015] When the vector offset direction is clockwise, the turning direction of the target virtual object is determined as the first turning direction;
[0016] When the vector offset direction is counterclockwise, the turning direction of the target virtual object is determined to be the second turning direction;
[0017] The turning angle of the target virtual object is determined based on the vector offset angle.
[0018] Optionally, determining the turning direction and turning angle of the target virtual object based on the vector offset direction and vector offset angle of the movement trajectory includes:
[0019] In response to the vector offset direction of the movement trajectory, which corresponds to a preset vector offset direction of the area of the movement trajectory in the graphical user interface, the turning direction and turning angle of the target virtual object are determined based on the vector offset direction and vector offset angle of the movement trajectory.
[0020] Optionally, determining the turning angle of the target virtual object based on the vector offset angle includes:
[0021] In response to the vector offset angle being within a preset angle threshold range, the turning angle of the target virtual object is determined based on the vector offset angle;
[0022] In response to the vector offset angle exceeding a preset angle threshold range, the target virtual object is controlled to turn at the maximum turning angle of the current turning direction.
[0023] Optionally, the method further includes:
[0024] In response to the sliding operation leaving the graphical user interface, the target virtual object is controlled to move in a straight line.
[0025] Optionally, the method further includes:
[0026] In response to a touch operation on the graphical user interface, the target virtual object is controlled to rotate by a preset angle in the target turning direction according to the target turning direction corresponding to the target triggering area where the touch operation is located.
[0027] An information processing apparatus executes an application on a processor of a terminal device and renders a graphical user interface on a touch screen of the terminal device, the graphical user interface including at least a moving target virtual object; the apparatus includes:
[0028] A steering control module is used to control the steering of the target virtual object in response to a swipe operation on the graphical user interface, based on the movement trajectory of the swipe operation on the graphical user interface.
[0029] Optionally, the steering control module is used to control the steering of the target virtual object according to the movement trajectory after the sliding operation meets preset conditions.
[0030] Optionally, the steering control module is used to control the steering of the target virtual object based on the movement trajectory after the offset in the first direction of the sliding operation reaches a preset offset.
[0031] Optionally, the steering control module includes:
[0032] The steering determination module is used to determine the steering direction and steering angle of the target virtual object based on the vector offset direction and vector offset angle of the movement trajectory.
[0033] A target virtual object steering module is used to control the steering of the target virtual object according to the steering direction and steering angle.
[0034] Optionally, the steering determination module includes:
[0035] The first steering direction determination module is used to determine the steering direction of the target virtual object as the first steering direction when the vector offset direction is clockwise.
[0036] The second steering direction determination module is used to determine the steering direction of the target virtual object as the second steering direction when the vector offset direction is counterclockwise.
[0037] The steering angle determination module is used to determine the steering angle of the target virtual object based on the vector offset angle.
[0038] Optionally, the steering determination module is configured to respond to the vector offset direction of the movement trajectory, which corresponds to a preset vector offset direction of the movement trajectory in the area of the graphical user interface, and determine the steering direction and steering angle of the target virtual object based on the vector offset direction and vector offset angle of the movement trajectory.
[0039] Optionally, the steering angle determination module includes:
[0040] The first steering angle determination module is used to determine the steering angle of the target virtual object based on the vector offset angle in response to the vector offset angle being within a preset angle threshold range.
[0041] The second steering angle determination module is used to control the target virtual object to turn according to the maximum steering angle of the current steering direction in response to the vector offset angle exceeding the preset angle threshold range.
[0042] Optionally, the device further includes:
[0043] A linear movement module is used to control the target virtual object to move in a straight line in response to the sliding operation leaving the graphical user interface.
[0044] Optionally, the device further includes:
[0045] Based on the trigger area turning module, it is used to respond to the touch operation of the graphical user interface, and control the target virtual object to rotate a preset angle in the target turning direction according to the target turning direction corresponding to the target trigger area where the touch operation is located.
[0046] An electronic device includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the information processing method described above.
[0047] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the information processing method described above.
[0048] This application has the following advantages:
[0049] In this embodiment, by responding to a swipe operation on the graphical user interface, the target virtual object is controlled to turn according to the movement trajectory of the swipe operation on the graphical user interface; it is possible to control the turning of the target virtual object by the movement trajectory corresponding to the swipe operation, bringing a new turning control experience to the user, and the operation is convenient. In addition, controlling the turning of the target virtual object by the movement trajectory can bring a more intuitive interactive experience to the user. Attached Figure Description
[0050] To more clearly illustrate the technical solution of this application, the drawings used in the description of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart illustrating the steps of an information processing method according to an embodiment of this application;
[0052] Figure 2 This is a schematic diagram illustrating the relationship between vector offset angle and target virtual object turning direction in an information processing method according to an embodiment of this application;
[0053] Figure 3 This is another schematic diagram illustrating the relationship between vector offset angle and target virtual object orientation in an information processing method according to an embodiment of this application;
[0054] Figure 4 This is a schematic diagram of the sliding trajectory and the moving trajectory in an information processing method according to an embodiment of this application;
[0055] Figure 5 This is a schematic diagram of a preset boundary and movement trajectory in an information processing method according to an embodiment of this application;
[0056] Figure 6 This is a schematic diagram of another steering control method in an information processing method according to an embodiment of this application;
[0057] Figure 7 This is a structural block diagram of an information processing device according to an embodiment of this application. Detailed Implementation
[0058] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0059] In racing games, players control the virtual vehicle's direction by tapping directional buttons or tilting their phones. When using directional buttons, each tap of the left turn button rotates the virtual vehicle a specified angle to the left. When navigating sharp curves, players need to continuously tap the corresponding turn button, requiring high tapping speed and making it difficult to intuitively link steering controls with the vehicle's movements, causing significant inconvenience. Similarly, when tilting the phone to control steering, players must maintain a constant tilt when cornering, making it difficult to observe the phone screen.
[0060] In view of this, the embodiments of this application provide an information processing method that controls the direction of a target virtual object by using the movement trajectory corresponding to the sliding operation; this brings a new steering control experience to the user and is easy to operate. In addition, controlling the direction of the target virtual object by using the movement trajectory can bring a more intuitive interactive experience to the user.
[0061] The information processing method provided in this application can be applied to electronic devices to facilitate user game operations. The electronic device can be hardware or software. When the electronic device is hardware, it can be implemented as a cluster of multiple servers or terminal devices, or as a single server or a single terminal device. When the electronic device is software, it can be installed on the hardware devices listed above.
[0062] Reference Figure 1 The diagram illustrates a flowchart of an information processing method according to an embodiment of this application, in which an application is executed on the processor of a terminal device and a graphical user interface is rendered on the touch screen of the terminal device, the graphical user interface including at least a moving target virtual object.
[0063] In this embodiment, the application running on the processor of the terminal device can be an application that needs to be downloaded and installed, or an application that can be used instantly; this embodiment does not limit this. The terminal device can be an electronic device such as a smartphone, tablet computer, game console, e-book reader, multimedia playback device, or wearable device.
[0064] In this embodiment, the application can be any application capable of providing a virtual environment for users to immerse themselves in and manipulate virtual objects within that virtual environment. Typically, this application is a game application, such as a multiplayer online racing game. Of course, besides game applications, other types of applications can also display virtual objects to users and provide corresponding functions to them. Examples include Virtual Reality (VR) applications, Augmented Reality (AR) applications, 3D map applications, military simulation applications, and social applications; this embodiment does not limit this. Furthermore, the form and corresponding functions of the virtual objects provided by different applications will vary, and these can be pre-configured according to actual needs; this embodiment does not limit this. Optionally, a client of the aforementioned application runs on the terminal device.
[0065] The aforementioned virtual environment refers to a scene provided by the client of an application (such as a game application) when it runs on a terminal device. This virtual environment is a scenario created for virtual objects to engage in activities (such as game competitions), such as virtual tracks, virtual houses, virtual islands, virtual maps, and virtual buildings. This virtual environment can be a simulation of the real world, a semi-simulated / semi-fictional environment, or a purely fictional environment. The virtual environment can be a two-dimensional virtual environment, a 2.5-dimensional virtual environment, or a three-dimensional virtual environment; this application does not limit this.
[0066] The aforementioned target virtual object can be a virtual object controlled by a user account in an application. In this embodiment, the target virtual object can be a virtual vehicle, a virtual ship, a virtual aircraft, etc.
[0067] The virtual environment display screen refers to the screen corresponding to the virtual environment shown to the user in the graphical user interface. This virtual environment display screen can be the image captured by a virtual camera from the virtual environment. In one embodiment, the virtual camera can capture the virtual environment image from the third-person perspective of a target virtual object controlled by the user. Optionally, the virtual camera is positioned diagonally above the target virtual object, and the application observes the virtual environment with the target virtual object as the center through the virtual camera, capturing the display screen of the virtual environment centered on the target virtual object. In another embodiment, the virtual camera captures the virtual environment display screen from the first-person perspective of the target virtual object. Optionally, the virtual camera is positioned directly in front of the target virtual object, and the application observes the virtual environment from the perspective of the target virtual object through the virtual camera, capturing the display screen of the virtual environment with the target virtual object as the first-person perspective. Of course, in other possible embodiments, the placement position of the virtual camera is adjustable in real time. For example, the placement position of the virtual camera can be adjusted in response to the user's operation of changing the virtual camera's placement position.
[0068] In this embodiment of the application, the display screen of the virtual environment is used to display the virtual environment provided by the racing game, and may include the screen in front of the target virtual object's field of vision, so that the user can observe the driving route, road conditions and other information in front of the target virtual object.
[0069] The method may include the following steps:
[0070] Step 101: In response to a swipe operation on the graphical user interface, control the target virtual object to turn according to the movement trajectory of the swipe operation on the graphical user interface.
[0071] This application embodiment controls the direction of a target virtual object by responding to a sliding operation on the graphical user interface and controlling the direction of the target virtual object according to the movement trajectory of the sliding operation on the graphical user interface. It can realize the control of the direction of the target virtual object by the movement trajectory corresponding to the sliding operation, bringing a new turning control experience to the user and making the operation convenient. In addition, controlling the direction of the target virtual object by the movement trajectory can bring a more intuitive interactive experience to the user.
[0072] The information processing method in this exemplary embodiment will now be further described.
[0073] In step 101, in response to a swipe operation on the graphical user interface, the target virtual object is controlled to turn according to the movement trajectory of the swipe operation on the graphical user interface.
[0074] In this embodiment, when a swipe operation is detected on the graphical user interface, the movement trajectory corresponding to the swipe operation can be determined by following the touch position of the swipe operation on the graphical user interface, and then the target virtual object can be controlled to turn according to the movement trajectory.
[0075] In an optional embodiment of this application, the vector direction of the movement trajectory can be converted into the orientation of the target virtual object to control the turning of the target virtual object. After detecting a sliding operation, the tangent direction of the sliding trajectory corresponding to the sliding operation, i.e., the vector direction of the movement trajectory, can be determined in real time.
[0076] For example, the vector direction of the movement trajectory can be used as the orientation of the target virtual object. For instance, in a Cartesian coordinate system parallel to the graphical user interface, when the vector direction of the movement trajectory makes a 30-degree angle with the horizontal axis, adjusting the orientation of the target virtual object to also make a 30-degree angle with the horizontal axis, combined with the orientation of the target virtual object before adjustment, allows us to determine the turning direction and angle of the target virtual object. Assuming the orientation before adjustment makes a 45-degree angle with the horizontal axis, the target virtual object would then turn right with a rotation angle of 15 degrees.
[0077] For example, the vector direction of the movement trajectory can be transformed according to a preset rule, and the transformed result can be used as the orientation of the target virtual object. The preset rule can be the product of the vector direction of the movement trajectory and a preset coefficient. For instance, in a Cartesian coordinate system parallel to the graphical user interface, when the angle between the vector direction of the movement trajectory and the horizontal axis is 30 degrees, if the preset coefficient is 0.5, the transformed result is 15 degrees. Adjusting the orientation of the target virtual object to have an angle of 15 degrees with the horizontal axis, combined with the orientation of the target virtual object before adjustment, allows determination of the turning direction and angle of the target virtual object. It should be noted that the relationship between the turning angle of the target virtual object and the vector offset angle of the movement trajectory can be either linear or non-linear, and those skilled in the art can set it as needed; this application does not limit this.
[0078] In another optional embodiment of this application, the turning direction and turning angle of the target virtual object can be determined based on the vector offset direction and vector offset angle of the movement trajectory, so as to control the turning of the target virtual object according to the determined turning direction and turning angle. The vector offset direction and vector offset angle represent the vector change of the movement trajectory at two adjacent detection time points. The detection time points can be real-time or determined by a set time interval. The vector offset direction includes clockwise and counterclockwise directions.
[0079] For example, when the vector offset direction is clockwise, the turning direction of the target virtual object is determined as the first turning direction; when the vector offset direction is counterclockwise, the turning direction of the target virtual object is determined as the second turning direction; then, the turning angle of the target virtual object is determined based on the vector offset angle. For instance, when the vector offset direction is clockwise, the turning direction of the target virtual object is determined as right turn, and then the specific right turn angle of the target virtual object is determined based on the vector offset angle. Alternatively, when the vector offset direction is clockwise, the turning direction of the target virtual object is determined as left turn, and then the specific right turn angle of the target virtual object is determined based on the vector offset angle.
[0080] In an optional embodiment of this application, the target virtual object is not limited to a maximum turning angle. The turning angle of the target virtual object is determined based on the vector offset angle. Specifically, the vector offset angle can be converted into the turning angle of the target virtual object.
[0081] In one example, the process of converting the vector offset angle into the turning angle of the target virtual object can be to directly use the vector offset angle as the turning angle of the target virtual object. For example, when the vector offset angle is 30 degrees, the turning angle of the target virtual object is 30 degrees.
[0082] like Figure 2 and Figure 3 As shown, at detection time t, the movement trajectory vector is The orientation of the target virtual object is At the detection time point t+1, which is adjacent to detection time point t, the movement trajectory vector is... The vector offset angle between detection time point t+1 and detection time point t is The vector offset direction is clockwise. If clockwise corresponds to a right turn, then the target virtual object turns to the right according to the vector offset angle ΔV. Since the orientation of the target virtual object at detection time t is... The orientation of the target virtual object at the detection time point t+1 is: By determining the turning direction of the target virtual object through the vector offset direction of the movement trajectory, and simultaneously determining the turning angle of the target virtual object through the vector offset angle of the movement trajectory, a simpler and more intuitive interactive experience can be presented to the user, and the use of interactive controls can be reduced.
[0083] In another example, the process of converting the vector offset angle into the turning angle of the target virtual object can also involve converting the vector offset angle according to a set conversion rule, and using the converted result as the turning angle of the target virtual object. The conversion rule can be the product of the vector offset angle and a preset coefficient. For example, when the vector offset angle is 30 degrees and the preset coefficient is 0.5, the converted result is 15 degrees, meaning the turning angle of the target virtual object is 15 degrees. It should be noted that the relationship between the turning angle of the target virtual object and the vector offset angle of the sliding operation trajectory can be either linear or non-linear. Those skilled in the art can set this relationship as needed, and this application does not impose any limitations on it.
[0084] In another optional embodiment of this application, the target virtual object is limited by a maximum turning angle, which refers to the maximum angle that the target virtual object is allowed to rotate in a single turn. The determination of the target virtual object's turning angle based on the vector offset angle may include:
[0085] When the vector offset angle is within a preset angle threshold range, the turning angle of the target virtual object is determined based on the vector offset angle;
[0086] When the vector offset angle exceeds the preset angle threshold range, the target virtual object is controlled to turn according to the maximum turning angle of the current turning direction.
[0087] In this embodiment, the vector offset angle is compared with a preset angle threshold range. When the vector offset angle is within the preset angle threshold range, the turning angle of the target virtual object is determined based on the vector offset angle. Specifically, the vector offset angle can be converted into the turning angle of the target virtual object. This conversion can be done by directly using the vector offset angle as the turning angle of the target virtual object; for example, when the vector offset angle is 30 degrees, the turning angle of the target virtual object is 30 degrees. Alternatively, the vector offset angle can be converted according to a set conversion rule, and the result is used as the turning angle of the target virtual object. The conversion rule can be the product of the vector offset angle and a preset coefficient. For example, when the vector offset angle is 30 degrees and the preset coefficient is 0.5, the conversion result is 15 degrees, meaning the turning angle of the target virtual object is 15 degrees. When the vector offset angle exceeds the preset angle threshold range, the turning angle of the target virtual object is determined to be the maximum turning angle. For example, assuming the preset angle threshold range is 0-90 degrees and the maximum turning angle is 45 degrees, when the vector offset angle is 100 degrees, it exceeds the preset angle threshold range, and the turning angle of the target virtual object is determined to be the maximum turning angle of 45 degrees. By comparing the vector offset angle with a preset angle threshold range, the turning angle of the target virtual object can be determined, ensuring that the target virtual object turns normally according to the determined turning angle.
[0088] Furthermore, in an optional embodiment of this application, the determination of the turning direction and turning angle of the target virtual object based on the vector offset direction and vector offset angle of the movement trajectory may further include:
[0089] When the vector offset direction of the movement trajectory matches the preset vector offset direction corresponding to the area of the movement trajectory in the graphical user interface, the turning direction and turning angle of the target virtual object are determined according to the vector offset direction and vector offset angle of the movement trajectory.
[0090] In this embodiment, by pre-setting the correspondence between the area of the graphical user interface and the vector offset direction, the function of controlling the direction of the target virtual object according to the movement trajectory can only be triggered when the vector offset direction of the movement trajectory matches the preset vector offset direction corresponding to its area; this can enhance the fun of the interaction.
[0091] For example, considering that users are generally accustomed to using both hands to operate the game, the area to the left of the vertical center line of the graphical user interface can be used as the boundary, and the area to the right of the center line of the graphical user interface can be used as the second trigger area to control the target virtual object to rotate in the first turning direction. Furthermore, the first trigger area is associated with the counterclockwise direction of the vector offset direction, and the second trigger area is associated with the clockwise direction of the vector offset direction.
[0092] When the movement trajectory is in the first trigger area (left side of the graphical user interface) and the vector offset direction of the movement trajectory is counterclockwise, since the first trigger area is associated with the counterclockwise direction, that is, the vector offset direction of the movement trajectory matches the preset vector offset direction corresponding to its area, the turning direction and turning angle of the target virtual object can be determined according to the vector offset direction and vector offset angle of the movement trajectory.
[0093] When the movement trajectory is in the first trigger area (left side of the graphical user interface) and the vector offset direction of the movement trajectory is clockwise, the function of controlling the direction of the target virtual object cannot be triggered because the first trigger area is associated with the counterclockwise direction, that is, the vector offset direction of the movement trajectory does not match the preset vector offset direction corresponding to its area.
[0094] Optionally, to facilitate user operation, the area to the left of the center line of the graphical user interface is designated as the first trigger area for controlling the target virtual object to rotate in the first turning direction, and the area to the right of the center line of the graphical user interface is designated as the second trigger area for controlling the target virtual object to rotate in the second turning direction. The first turning direction is left-hand turn, and the second turning direction is right-hand turn. That is, the first trigger area to the left of the center line of the graphical user interface is used to control the target virtual object to turn left, and the second trigger area to the right of the center line of the graphical user interface is used to control the target virtual object to turn right. Furthermore, the first trigger area is associated with the counter-clockwise direction of the vector offset direction, and the second trigger area is associated with the clockwise direction of the vector offset direction; or, the first trigger area is associated with the clockwise direction of the vector offset direction, and the second trigger area is associated with the counter-clockwise direction of the vector offset direction.
[0095] It should be noted that the vector offset direction associated with the first and second trigger areas can be set by the user according to their personal operating habits, or it can be set by the system default. For example, when the user does not make any settings, the default association relationship is used. In this case, the default association relationship can be uniform and fixed, or it can be the association relationship that the user set / used last time.
[0096] This embodiment associates the vector offset direction with the corresponding trigger area. When the vector offset direction of the movement trajectory matches the preset vector offset direction corresponding to the trigger area it is in, the target virtual object is then controlled to turn according to the vector offset direction and vector offset angle of the movement trajectory, which can improve the fun of the interaction.
[0097] It should be noted that in other embodiments, the turning direction of the target virtual object can also be determined based on the area where the movement trajectory is located, and the turning angle of the target virtual object can be determined based on the vector offset angle of the movement trajectory. That is, the turning direction of the target virtual object is independent of the vector offset direction, and is only related to the turning direction associated with the area where the movement trajectory is located. In an embodiment that only provides a trigger area for controlling the turning of the target virtual object, for example, controlling the turning of the target virtual object only through the left half, lower left, or left side of the graphical user interface, the player can control the turning of the target virtual object by simply sliding with the left hand. When the movement trajectory of the sliding operation is clockwise, the target virtual object is controlled to turn right; when the movement trajectory of the sliding operation is counterclockwise, the target virtual object is controlled to turn left.
[0098] Furthermore, in an optional embodiment of this application, step 101, which controls the direction of the target virtual object based on the movement trajectory of the sliding operation on the graphical user interface, further includes:
[0099] After the preset conditions are met according to the sliding operation, the target virtual object is turned according to the movement trajectory of the graphical user interface.
[0100] In this embodiment, the target virtual object is controlled to turn only when the sliding operation meets preset conditions, based on the movement trajectory of the sliding operation in the graphical user interface. It can be understood that the movement trajectory in this embodiment is the trajectory formed by the sliding operation continuing to interact with the graphical user interface after the preset conditions are met. This embodiment uses preset conditions as a prerequisite for controlling the turning of the target virtual object based on the movement trajectory of the sliding operation in the graphical user interface, which can effectively prevent accidental operations. In different exemplary embodiments, the preset conditions may be different.
[0101] In an optional embodiment of this application, controlling the direction of the target virtual object based on the movement trajectory after the sliding operation meets preset conditions includes:
[0102] The target virtual object is controlled to turn based on the movement trajectory after the offset in the first direction reaches a preset offset based on the sliding operation.
[0103] In this embodiment, when a swipe operation is detected on the graphical user interface, a corresponding slide trajectory can be formed based on the touch position of the swipe operation on the graphical user interface. This slide trajectory is different from a movement trajectory. Specifically, the slide trajectory is the trajectory before the swipe operation meets a preset condition, while the movement trajectory is the trajectory after the swipe operation meets the preset condition. By obtaining the starting point and the real-time ending point of the slide trajectory, it is determined whether the first directional offset between the real-time ending point and the starting point reaches a preset offset. If it does, it indicates that the swipe operation meets the preset condition. If it does not, the first directional offset between the real-time ending point and the starting point of the slide trajectory is further determined against the preset offset. When the first directional offset reaches the preset offset, it indicates that the swipe operation meets the preset condition. The trajectory formed by the swipe operation at the trigger position of the graphical user interface thereafter is the movement trajectory. It can be understood that the starting point of the movement trajectory coincides with the touch position point when the swipe operation meets the preset condition. Optionally, part or all of the slide trajectory can also be a part of the movement trajectory, which can be flexibly set by those skilled in the art as needed.
[0104] In the Cartesian coordinate system parallel to the graphical user interface, the first direction can be either the vertical or horizontal direction of the graphical user interface. When the first direction is vertical, the offset is the difference between the ordinate of the real-time endpoint of the sliding trajectory and the ordinate of the starting point of the sliding trajectory. When the first direction is horizontal, the offset is the difference between the abscissa of the real-time endpoint of the sliding trajectory and the abscissa of the starting point of the sliding trajectory.
[0105] Considering that in racing games, target virtual objects generally cannot move laterally, and when users control the target virtual object to turn, they will perform a sliding operation according to the direction they want to control. If the lateral direction is taken as the primary direction, users need to deliberately slide laterally first to make the sliding operation meet the preset conditions, and then perform the sliding operation according to the direction they want to control. Although this can avoid accidental operation, it is difficult for users to distinguish when the sliding operation meets the preset conditions, which can easily lead to excessive lateral movement and control errors.
[0106] Therefore, to better align with player perception, the first direction is preferably the vertical direction, assuming the target virtual object moves vertically by default. The preset offset can be adjusted as needed; for example, it can be 24 pixels. This preset offset in the first direction helps distinguish whether a user's swipe operation is a valid swipe operation used to control the direction of the target virtual object.
[0107] For example, such as Figure 4As shown, when the operating medium is detected to be in contact with the graphical user interface, and during the contact state, the vertical offset relative to the initial touch position (X0, Y0) reaches a preset offset, it is determined that the sliding operation meets the preset conditions. The touch position (X1, Y1) at this time is taken as the starting point of the movement trajectory, i.e., Y1-Y0 = preset offset. The touch position of the operating medium relative to the graphical user interface while maintaining contact with the graphical user interface is then acquired as the real-time trajectory endpoint, thus obtaining the movement trajectory corresponding to the sliding operation. The operating medium can be the user's limbs, such as fingers, or other touch objects, such as styluses, touch finger sleeves, etc.
[0108] In another optional embodiment of this application, controlling the direction of the target virtual object based on the movement trajectory after the sliding operation meets the preset conditions includes:
[0109] The target virtual object is steered according to its movement trajectory after the sliding operation first contacts the preset boundary.
[0110] In this embodiment, determining whether to activate the function of controlling the direction of the target virtual object by sliding is based on whether the sliding operation contacts a preset boundary line, which can effectively prevent accidental touches. The preset boundary line is a dividing line with a visual indication effect in the graphical user interface; for example, when a sliding operation is detected, the preset boundary line is displayed in the graphical user interface. This exemplary embodiment does not limit the shape, size, or visual presentation effect of the preset boundary line. When the sliding operation first contacts the preset boundary line, it is determined that the sliding operation meets preset conditions, and the touch position of the sliding operation in the graphical user interface at this time is taken as the starting point of the corresponding movement trajectory, that is, the starting point of the movement trajectory is on the preset boundary line.
[0111] For example, such as Figure 5 As shown, when the operation medium is detected to be in contact with the graphical user interface, and during the contact state, the touch position of the operation medium and the graphical user interface coincides with any point in the preset boundary for the first time, that is, when the sliding operation first contacts the preset boundary, it is determined that the sliding operation meets the preset conditions. The touch position at this time is taken as the starting point of the movement trajectory. The operation medium continues to acquire the touch position of the graphical user interface while maintaining contact with the graphical user interface, and takes it as the real-time trajectory endpoint of the movement trajectory. Thus, the movement trajectory corresponding to the sliding operation can be obtained.
[0112] It should be noted that once the sliding operation meets the preset conditions, it will no longer check whether the sliding operation touches the preset boundary. That is, if the sliding operation touches the preset boundary again, it will not have any effect.
[0113] Furthermore, in an optional embodiment of this application, the above information processing method may further include:
[0114] When the sliding operation ends, control the target virtual object to move in a straight line.
[0115] In this embodiment, when the sliding operation ends, the target virtual object is no longer controlled to turn, so the target virtual object continues to move in a straight line.
[0116] Furthermore, in an optional embodiment of this application, the above information processing method may further include:
[0117] In response to a touch operation on the graphical user interface, determine the target trigger area where the touch operation is located;
[0118] Based on the target turning direction corresponding to the target triggering area, control the target virtual object to rotate by a preset angle in the target turning direction.
[0119] The graphical user interface in this embodiment may include a first trigger area and a second trigger area, the shape and size of which are not limited. The first trigger area corresponds to a first turning direction, and the second trigger area corresponds to a second turning direction. The touch operation can be a single click, where each click on the target trigger area causes the target virtual object to rotate by a preset angle in the target turning direction corresponding to the target trigger area. The touch operation can also be a long press. When the touch operation is a long press, a timer can be used to time the long press. When the timer reaches a preset duration, it is counted as a single click, and the timer is reset. Each time a single click is counted, the target virtual object is controlled to rotate by a preset angle in the target turning direction corresponding to the target trigger area. For example, the preset duration can be 0.2 seconds. The preset turning angle can be 0.1α, where α represents the maximum turning angle of the target virtual object.
[0120] For example, the first trigger area can be set in the area to the left of the center line of the graphical user interface, the second trigger area can be set in the area to the right of the center line of the graphical user interface, the first turning direction can be turning to the left, and the second turning direction can be turning to the right.
[0121] like Figure 6 As shown, when a touch operation is detected targeting the first trigger area, the target virtual object is controlled to turn left by a preset angle; when a touch operation is detected targeting the second trigger area, the target virtual object is controlled to turn right by a preset angle.
[0122] In this embodiment, there are two ways to control the turning of the target virtual object. One is to control the turning of the target virtual object by the movement trajectory corresponding to the sliding operation, as described above. The other is to control the turning of the target virtual object by touch operation on the target trigger area, according to the target turning direction and preset angle corresponding to the target trigger area.
[0123] Controlling the direction of a virtual object by swiping to follow its movement trajectory allows for quick and intuitive steering. Conversely, controlling the object's direction by tapping on a trigger area, based on the trigger area's corresponding steering direction and a preset angle, allows for fixed-angle steering adjustments. The combination of these two steering methods caters to different user needs for controlling the direction of virtual objects during gameplay.
[0124] In practical applications, when the target virtual object needs to pass through a curve with a large angle and a long length, the user can use a swipe operation to control the direction of the target virtual object, that is, control the direction of the target virtual object by the movement trajectory corresponding to the swipe operation; when the target object needs to pass through a curve with a small angle and a short length, the user can use a touch operation to control the direction of the target virtual object, that is, control the direction of the target virtual object by touching the target trigger area, according to the target turning direction and preset angle corresponding to the target trigger area.
[0125] In this embodiment, by responding to a swipe operation on the graphical user interface, the target virtual object is controlled to turn according to the movement trajectory of the swipe operation on the graphical user interface; it is possible to control the turning of the target virtual object by the movement trajectory corresponding to the swipe operation, bringing a new turning control experience to the user, and the operation is convenient. In addition, controlling the turning of the target virtual object by the movement trajectory can bring a more intuitive interactive experience to the user.
[0126] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0127] Reference Figure 7This diagram illustrates a structural block diagram of an embodiment of an information processing apparatus according to this application. Corresponding to the above-described information processing method embodiment, it executes an application program on the processor of a terminal device and renders a graphical user interface on the touch screen of the terminal device. The graphical user interface at least includes a moving target virtual object. The information processing apparatus provided in this application embodiment may include the following modules:
[0128] Steering control module 701 is used to control the steering of the target virtual object in response to a sliding operation on the graphical user interface, based on the movement trajectory of the sliding operation on the graphical user interface.
[0129] Optionally, the steering control module 701 is used to control the steering of the target virtual object according to the movement trajectory after the sliding operation meets the preset conditions.
[0130] Optionally, the steering control module 701 is used to control the steering of the target virtual object based on the movement trajectory after the offset in the first direction of the sliding operation reaches a preset offset.
[0131] Optionally, the steering control module 701 includes:
[0132] The steering determination module is used to determine the steering direction and steering angle of the target virtual object based on the vector offset direction and vector offset angle of the movement trajectory.
[0133] A target virtual object steering module is used to control the steering of the target virtual object according to the steering direction and steering angle.
[0134] Optionally, the steering determination module includes:
[0135] The first steering direction determination module is used to determine the steering direction of the target virtual object as the first steering direction when the vector offset direction is clockwise.
[0136] The second steering direction determination module is used to determine the steering direction of the target virtual object as the second steering direction when the vector offset direction is counterclockwise.
[0137] The steering angle determination module is used to determine the steering angle of the target virtual object based on the vector offset angle.
[0138] Optionally, the steering determination module is configured to respond to the vector offset direction of the movement trajectory, which corresponds to a preset vector offset direction of the movement trajectory in the area of the graphical user interface, and determine the steering direction and steering angle of the target virtual object based on the vector offset direction and vector offset angle of the movement trajectory.
[0139] Optionally, the steering angle determination module includes:
[0140] The first steering angle determination module is used to determine the steering angle of the target virtual object based on the vector offset angle in response to the vector offset angle being within a preset angle threshold range.
[0141] The second steering angle determination module is used to control the target virtual object to turn according to the maximum steering angle of the current steering direction in response to the vector offset angle exceeding the preset angle threshold range.
[0142] Optionally, the device further includes:
[0143] A linear movement module is used to control the target virtual object to move in a straight line in response to the sliding operation leaving the graphical user interface.
[0144] Optionally, the device further includes:
[0145] Based on the trigger area turning module, it is used to respond to the touch operation of the graphical user interface, and control the target virtual object to rotate a preset angle in the target turning direction according to the target turning direction corresponding to the target trigger area where the touch operation is located.
[0146] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0147] This application also discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the information processing method described above.
[0148] This application also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the information processing method described above.
[0149] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0150] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0151] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0152] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0154] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0155] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0156] The above provides a detailed description of an information processing method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An information processing method, characterized in that, The method comprises executing an application on a terminal device's processor and rendering a graphical user interface (GUI) on the terminal device's touchscreen display, the GUI containing at least a moving target virtual object; the method includes: In response to a swipe operation on the graphical user interface, the target virtual object is controlled to turn according to the movement trajectory of the swipe operation on the graphical user interface; wherein the orientation of the target virtual object is determined based on the tangent direction of the movement trajectory. In response to the sliding operation leaving the graphical user interface, the target virtual object is controlled to move in a straight line; The step of controlling the target virtual object to turn according to the movement trajectory of the sliding operation in the graphical user interface includes: when the vector offset direction of the movement trajectory matches the preset vector offset direction corresponding to the area of the movement trajectory in the graphical user interface, controlling the target virtual object to turn according to the movement trajectory, wherein the vector offset direction of the movement trajectory is determined based on the movement trajectory vectors corresponding to two adjacent detection time points, and the vector offset direction of the movement trajectory is used to determine the turning of the target virtual object.
2. The method according to claim 1, characterized in that, The step of controlling the direction of the target virtual object based on the movement trajectory of the sliding operation on the graphical user interface includes: The target virtual object is controlled to turn based on the movement trajectory after the sliding operation meets the preset conditions.
3. The method according to claim 2, characterized in that, The step of controlling the direction of the target virtual object based on the movement trajectory after the sliding operation meets the preset conditions includes: The target virtual object is controlled to turn based on the movement trajectory after the offset in the first direction reaches a preset offset based on the sliding operation.
4. The method according to any one of claims 1-3, characterized in that, The step of controlling the direction of the target virtual object based on the movement trajectory of the sliding operation on the graphical user interface includes: Based on the vector offset direction and vector offset angle of the movement trajectory, determine the turning direction and turning angle of the target virtual object; The target virtual object is steered according to the steering direction and steering angle.
5. The method according to claim 4, characterized in that, Determining the turning direction and turning angle of the target virtual object based on the vector offset direction and vector offset angle of the movement trajectory includes: When the vector offset direction is clockwise, the turning direction of the target virtual object is determined as the first turning direction; When the vector offset direction is counterclockwise, the turning direction of the target virtual object is determined to be the second turning direction; The turning angle of the target virtual object is determined based on the vector offset angle.
6. The method according to claim 5, characterized in that, Determining the turning angle of the target virtual object based on the vector offset angle includes: In response to the vector offset angle being within a preset angle threshold range, the turning angle of the target virtual object is determined based on the vector offset angle; In response to the vector offset angle exceeding a preset angle threshold range, the target virtual object is controlled to turn at the maximum turning angle of the current turning direction.
7. The method according to claim 1, characterized in that, The method further includes: In response to a touch operation on the graphical user interface, the target virtual object is controlled to rotate by a preset angle in the target turning direction according to the target turning direction corresponding to the target triggering area where the touch operation is located.
8. An information processing device, characterized in that, The apparatus comprises: executing an application on a processor of a terminal device and rendering a graphical user interface on a touchscreen display of the terminal device, the graphical user interface including at least a moving target virtual object; the apparatus includes: A steering control module is configured to respond to a sliding operation on the graphical user interface and control the steering of the target virtual object according to the movement trajectory of the sliding operation on the graphical user interface; wherein the orientation of the target virtual object is determined based on the tangent direction of the movement trajectory; A linear movement module is used to control the target virtual object to move in a straight line in response to the sliding operation leaving the graphical user interface; The step of controlling the target virtual object to turn according to the movement trajectory of the sliding operation in the graphical user interface includes: when the vector offset direction of the movement trajectory matches the preset vector offset direction corresponding to the area of the movement trajectory in the graphical user interface, controlling the target virtual object to turn according to the movement trajectory, wherein the vector offset direction of the movement trajectory is determined based on the movement trajectory vectors corresponding to two adjacent detection time points, and the vector offset direction of the movement trajectory is used to determine the turning of the target virtual object.
9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the information processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the information processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Virtual object control method and device, storage medium and electronic device
CN111773720A