Control method and device of virtual role, storage medium and electronic equipment

文档序号:1896900 发布日期:2021-11-30 浏览:15次 中文

阅读说明:本技术 虚拟角色的控制方法和装置、存储介质及电子设备 (Control method and device of virtual role, storage medium and electronic equipment ) 是由 邹聃成 仇蒙 何晶晶 刘博艺 崔维健 田聪 于 2021-09-09 设计创作,主要内容包括:本发明公开了一种虚拟角色的控制方法和装置、存储介质及电子设备。其中,该方法包括:显示虚拟场景中的虚拟角色以及虚拟摇杆,虚拟角色为用户操控的角色;响应对虚拟摇杆执行的操作,控制虚拟角色在虚拟场景中移动;在虚拟角色移动的过程中,若虚拟摇杆被拖拽到第一区域,且虚拟角色的一定范围内存在障碍物,控制虚拟角色执行翻越所述障碍物的动作。本发明解决了对虚拟角色执行控制操作的效率低的技术问题。(The invention discloses a control method and device of a virtual role, a storage medium and electronic equipment. Wherein, the method comprises the following steps: displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user; responding to the operation executed on the virtual rocker, and controlling the virtual character to move in the virtual scene; in the process of moving the virtual character, if the virtual rocker is dragged to the first area and an obstacle exists in a certain range of the virtual character, controlling the virtual character to execute an action of crossing the obstacle. The invention solves the technical problem of low efficiency of executing control operation on the virtual role.)

1. A control method of a virtual character, which is applied to a target game application, includes:

displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user;

responding to the operation executed on the virtual rocker, and controlling the virtual character to move in the virtual scene;

in the process of moving the virtual character, if the virtual rocker is dragged to a first area and an obstacle exists in a certain range of the virtual character, controlling the virtual character to execute an action of crossing the obstacle.

2. The method of claim 1, wherein controlling the virtual character to move in the virtual scene in response to the operation performed on the virtual joystick comprises:

and responding to the operation that the virtual rocker is dragged to the second area, and controlling the moving direction of the virtual character according to the position of the virtual rocker in the second area.

3. The method of claim 2, further comprising:

displaying the first area when the virtual rocker is dragged out of the second area;

and acquiring the operation that the virtual rocker is dragged from the second area to the first area.

4. The method of claim 3, wherein after the virtual rocker is dragged from the second region to the first region, the method further comprises:

canceling the display of the first area when the virtual joystick is dragged out of the first area.

5. The method of claim 1, further comprising:

and in the process of moving the virtual character, if the virtual rocker is dragged to the first area and no obstacle exists in a certain range of the virtual character, controlling the virtual character to keep a current moving state.

6. The method of claim 1, further comprising:

and in the process of controlling the virtual character to execute the action of crossing the obstacle, if the virtual rocker moves out of the first area, the virtual character is cancelled to execute the action of crossing the obstacle.

7. The method of claim 1, further comprising:

acquiring a setting instruction on a setting interface of the target game application;

and responding to the setting instruction, setting the size of the first area according to the size indicated by the setting instruction, and setting the first area at the position indicated by the setting instruction.

8. The method of claim 2, wherein said controlling the direction in which the virtual character moves based on the position of the virtual joystick within the second zone comprises:

under the condition that the virtual rocker is located at the left position in the second area, controlling the virtual character to move leftwards;

under the condition that the virtual rocker is located at the right position in the second area, controlling the virtual character to move rightwards;

under the condition that the virtual rocker is located at the upper position in the second area, controlling the virtual character to move forwards;

and under the condition that the virtual rocker is positioned at the lower position in the second area, controlling the virtual character to move backwards.

9. The method of any of claims 1-8, wherein controlling the virtual character to perform the action of flipping over the obstacle comprises:

controlling the virtual character to execute a target action corresponding to the type of the obstacle so that the virtual character climbs from one side of the obstacle to the other side of the obstacle, wherein the target action comprises a jumping action or a climbing action.

10. A control device for a virtual character, applied to a target game application, comprising:

the display module is used for displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user;

the first control module is used for responding to the operation executed on the virtual rocker and controlling the virtual character to move in the virtual scene;

and the second control module is used for controlling the virtual character to execute an action of crossing over the obstacle if the virtual rocker is dragged to the first area and the obstacle exists in a certain range of the virtual character in the moving process of the virtual character.

11. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 9.

12. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 9 by means of the computer program.

Technical Field

The invention relates to the field of computers, in particular to a method and a device for controlling a virtual character, a storage medium and electronic equipment.

Background

In the related game, a large number of obstacles such as shelters, houses and the like exist in a game scene, and a player needs to control the virtual character to cross different types of obstacles in the game process, for example, the virtual character can be controlled to turn over a low fence or directly turn over from a window and enter a house. Such obstacle-surmounting operations are quite common in game flow.

At present, when a player operates a game, the left hand is required to control the motion direction of a virtual character through a rocker, and the right hand controls the virtual character to execute a jumping action to cross an obstacle through a touch virtual key. The operation of the player by the left hand and the right hand is complicated, so that the player is inconvenient to operate the virtual character, and the operation efficiency of the player on the virtual character in the game is low.

In addition, some players often trigger the jumping action in place when not aiming at the obstacle, and in such a case, the virtual character operated by the player can perform the jumping action back and forth in place, so that the player cannot smoothly cross the obstacle. On one hand, in the process of jumping back and forth of the virtual character, the virtual character is likely to be attacked by enemies and is easy to be eliminated. On the other hand, the jumping action in place cannot cross the obstacle, so that the multiple execution operations performed by the player are ineffective, and the problem of operation waste exists.

In view of the above problems, no effective solution has been proposed.

Disclosure of Invention

The embodiment of the invention provides a method and a device for controlling a virtual character, a storage medium and electronic equipment, which are used for at least solving the technical problem of low efficiency of executing control operation on the virtual character.

According to an aspect of an embodiment of the present invention, there is provided a method for controlling a virtual character, including: displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user; responding to the operation executed on the virtual rocker, and controlling the virtual character to move in the virtual scene; in the process of moving the virtual character, if the virtual rocker is dragged to a first area and an obstacle exists in a certain range of the virtual character, controlling the virtual character to execute an action of crossing the obstacle.

Optionally, controlling the virtual character to move in the virtual scene in response to an operation performed on the virtual joystick includes: and responding to the operation that the virtual rocker is dragged to the second area, and controlling the moving direction of the virtual character according to the position of the virtual rocker in the second area.

Optionally, the method further comprises: displaying the first area when the virtual rocker is dragged out of the second area; and acquiring the operation that the virtual rocker is dragged from the second area to the first area.

Optionally, after the virtual joystick is dragged from the second region to the first region, the method further comprises: canceling the display of the first area when the virtual joystick is dragged out of the first area.

Optionally, the method further comprises: and in the process of moving the virtual character, if the virtual rocker is dragged to the first area and no obstacle exists in a certain range of the virtual character, controlling the virtual character to keep a current moving state.

Optionally, the method further comprises: and in the process of controlling the virtual character to execute the action of crossing the obstacle, if the virtual rocker moves out of the first area, the virtual character is cancelled to execute the action of crossing the obstacle.

Optionally, the method further comprises: acquiring a setting instruction on a setting interface of the target game application; and responding to the setting instruction, setting the size of the first area according to the size indicated by the setting instruction, and setting the first area at the position indicated by the setting instruction.

Optionally, the controlling the direction in which the virtual character moves according to the position of the virtual joystick in the second area includes: under the condition that the virtual rocker is located at the left position in the second area, controlling the virtual character to move leftwards; under the condition that the virtual rocker is located at the right position in the second area, controlling the virtual character to move rightwards; under the condition that the virtual rocker is located at the upper position in the second area, controlling the virtual character to move forwards; and under the condition that the virtual rocker is positioned at the lower position in the second area, controlling the virtual character to move backwards.

Optionally, controlling the virtual character to perform an action of crossing the obstacle includes: controlling the virtual character to execute a target action corresponding to the type of the obstacle so that the virtual character climbs from one side of the obstacle to the other side of the obstacle, wherein the target action comprises a jumping action or a climbing action.

According to another aspect of the embodiments of the present invention, there is also provided a control apparatus for a virtual character, including: the display module is used for displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user; the first control module is used for responding to the operation executed on the virtual rocker and controlling the virtual character to move in the virtual scene; and the second control module is used for controlling the virtual character to execute an action of crossing over the obstacle if the virtual rocker is dragged to the first area and the obstacle exists in a certain range of the virtual character in the moving process of the virtual character.

According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the control method of the virtual character described above when running.

According to still another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the control method of the virtual character through the computer program.

In the embodiment of the invention, the operation instruction for controlling the virtual character to execute the crossing action is generated by triggering the virtual rocker, and the virtual rocker can also control the movement direction of the virtual character. The method and the device can realize the control of the motion direction of the virtual character and the crossing of the barrier by one hand, and the player can realize the control by one hand, thereby facilitating the control of the player on the virtual character and improving the efficiency of executing control operation on the virtual character.

When an operation instruction for instructing the virtual character to cross the obstacle is acquired, the virtual character is not immediately controlled to execute the action of crossing the obstacle, whether the obstacle exists in a preset range of the virtual obstacle is detected, if the obstacle exists, the virtual character is controlled to execute the action of crossing the obstacle, and if the obstacle does not exist, the virtual character continues to keep the current moving state. Therefore, the problem of operation waste caused by the fact that the player controls the virtual character to perform the action of crossing the obstacle under the condition that the player does not aim at the obstacle can be avoided.

Drawings

The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:

FIG. 1 is a schematic diagram of an application environment of an alternative virtual character control method according to an embodiment of the present invention;

fig. 2 is a flowchart illustrating a control method of a virtual character according to an embodiment of the present invention;

FIG. 3 is a diagram illustrating a first game screen according to an alternative embodiment of the present invention;

FIG. 4 is a diagram of a second game screen in accordance with an alternative embodiment of the present invention;

FIG. 5 is a schematic illustration of a game screen in accordance with an alternative embodiment of the present invention;

FIG. 6 is a first schematic view of a single-handed operation according to an alternative embodiment of the present invention;

FIG. 7 is a second schematic view of a single-handed operation in accordance with an alternative embodiment of the present invention;

FIG. 8 is an illustration of obstacle detection according to an alternative embodiment of the present invention;

FIG. 9 is a diagram of a game screen four in accordance with an alternative embodiment of the present invention;

FIG. 10 is a schematic view of a function setting interface according to an alternative embodiment of the present invention;

FIG. 11 is an overall flow chart according to an alternative embodiment of the present invention;

FIG. 12 is a schematic structural diagram of an alternative control device for a virtual character according to an embodiment of the present invention;

fig. 13 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.

Detailed Description

In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.

According to an aspect of the embodiments of the present invention, a method for controlling a virtual character is provided, and optionally, as an optional implementation manner, the method for controlling a virtual character may be applied to, but is not limited to, an environment as shown in fig. 1. The system environment includes a user device 102, a network 110, and a server 112.

Optionally, the user equipment 102 includes: memory 104, processor 106, and display 108. The memory is used for storing virtual scenes, virtual characters, obstacles and the like in the target game application. The processor is used for processing the operation instructions, including but not limited to instructing the virtual character to perform the action of crossing the obstacle and controlling the movement direction of the virtual character. The display may be used to display virtual scenes, virtual characters, etc. In this embodiment, the user equipment may be a user equipment configured with a target client, and may include, but is not limited to, at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), notebook computers, tablet computers, palm computers, MID (Mobile Internet Devices), PAD, desktop computers, smart televisions, etc. The target client may be a video client, an instant messaging client, a browser client, an educational client, etc. Such networks may include, but are not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communication. The server may be a single server, a server cluster composed of a plurality of servers, or a cloud server.

Optionally, the network 110 may include, but is not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communication.

Alternatively, the server 112 may be a single server, a server cluster composed of a plurality of servers, or a cloud server. The server includes: database 114, processing engine 116. The database is used for storing data including, but not limited to, game scenes, virtual characters, obstacles, etc. in the target game application. The processing engine may be used to control the avatar, including but not limited to controlling the avatar to move within the virtual scene, and controlling the avatar to perform actions that cross obstacles. The above is merely an example, and this is not limited in this embodiment.

Optionally, as an optional implementation manner, as shown in fig. 2, the method for controlling a virtual character may be applied to a target game application, and includes:

step S202, displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user;

the virtual scene is a game scene in the target game application, and the virtual character can be an object manipulated by a player in the game scene. The target game application may be a shooting game application, a running game application, or other game applications that may exist in a scene that spans obstacles, and the type of game application is not limited herein. The player manipulates the virtual character through the virtual joystick, including but not limited to controlling the virtual character to move in the game scene and controlling the virtual character to perform an action of crossing an obstacle in the target game application.

Step S204, responding to the operation executed on the virtual rocker and controlling the virtual role to move in the virtual scene;

the virtual rocker can control the virtual character to move in the game, including but not limited to walking, running and other movement modes, and can also control the movement direction of the virtual character, including but not limited to moving leftwards, rightwards, forwards, backwards and the like.

Step S206, in the process of moving the virtual character, if the virtual rocker is dragged to a first area and an obstacle exists in a certain range of the virtual character, controlling the virtual character to execute an action of crossing the obstacle.

The first area is an area displayed on a game screen of a target game application, a user can set the size and the display position of the first area in advance, the first area can also be called a judgment area, when a virtual rocker is dragged to the judgment area, whether an obstacle exists in a preset range of a virtual character is detected, if the obstacle exists, the virtual character is controlled to execute an action of crossing the obstacle, and the preset range can be set according to an actual situation. For example, at a distance of 5 meters, or 10 meters, from the virtual character. And if the distance between the preset range and the virtual character is within 5 meters, controlling the virtual character to execute the action of turning over the obstacle if the distance between the preset range and the virtual character is within 5 meters.

Taking the preset range as the area within 5 meters from the virtual character as an example, if it is detected that no obstacle capable of crossing exists within 5 meters of the virtual character, the virtual character is controlled to continue to keep the current moving state in the game scene. For example, if the current movement state of the virtual character is forward running. If the virtual rocker is dragged to the judging area, and no obstacle which can be crossed exists in the preset range, the virtual character continues to keep the moving state of running forwards.

Optionally, controlling the virtual character to move in the virtual scene in response to an operation performed on the virtual joystick includes: and responding to the operation that the virtual rocker is dragged to the second area, and controlling the moving direction of the virtual character according to the position of the virtual rocker in the second area.

As an optional embodiment, the second area is an area for controlling a movement state of the virtual character. If the virtual rocker is dragged to the second area, the moving direction of the virtual character can be controlled through the position of the virtual rocker in the second area. Fig. 3 is a schematic diagram of a game screen according to an alternative embodiment of the present invention, which includes a virtual character 300 and an obstacle 304, a virtual joystick 301 in the left portion of fig. 3, and a second area 302. The player can control the action performed by the virtual character through the virtual joystick 301, for example, when the virtual joystick 301 is located in the second area 302, the movement direction of the virtual character can be controlled, for example, the virtual joystick 301 is located at the position of the left arrow on the left side in the second area, the virtual character is controlled to move to the left, for example, the virtual joystick 301 is located at the position of the right arrow in the second area 302, and the virtual character is controlled to move to the right.

And when the touch virtual rocker moves out of the second area, displaying the first area in the game picture. Referring to fig. 4, which is a schematic diagram of a game screen according to an alternative embodiment of the present invention, a player may control a position of a virtual joystick 401 in the game screen by dragging, and as shown in the figure, when it is detected that the virtual joystick 401 is dragged out of a second area, a first area 402 is displayed in the game screen to remind the player of the position of the first area. If the player continues to drag the virtual joystick 401 to the first area 402, it starts to detect whether an obstacle exists within the preset range of the virtual character. As shown in fig. 5, the player may continue to drag the virtual joystick 501 to the first area 502, start to detect whether an obstacle exists within a preset range of the virtual character when the virtual joystick 501 is located in the first area 502, control the virtual character to execute an action of crossing the obstacle if the obstacle exists, and control the virtual character to continue to execute the current movement state if the obstacle does not exist.

In the above embodiment, the virtual joystick can control the movement direction of the virtual character and also can control the virtual character to perform the action of crossing the obstacle, so that the player can realize the one-hand operation.

Optionally, the method further comprises: displaying the first area when the virtual rocker is dragged out of the second area; and acquiring the operation that the virtual rocker is dragged from the second area to the first area.

As an alternative implementation, fig. 6 is a schematic diagram of a one-handed operation according to an alternative embodiment of the present invention. When the player touches the virtual stick to slide 601 to be in the second area 602, the moving direction of the virtual character can be controlled. When the player drags the virtual stick 601 out of the second region, the first region 603 is displayed in the game screen. When the virtual rocker is moved upwards to the first area along the Y axis, whether an obstacle exists in front of the virtual character controlled by the player in the current game scene is judged, if the obstacle exists, whether the obstacle is the obstacle which can be overturned is judged, and if the obstacle is confirmed to be the obstacle which can be overturned, the virtual character controlled by the player starts to execute the action of overturning the obstacle. If it is determined that the obstacle cannot be reversed or no obstacle exists, the virtual character controlled by the player continues to keep the current moving state in the game scene without executing the movement of reversing the obstacle, for example, if the virtual character is running forward before the obstacle determination, the virtual character continues to keep the movement of running forward and continues to detect whether or not the virtual stick moves into the first area.

In this embodiment, if the virtual joystick moves out of the second area, it is determined to be dragged, and at this time, the first area is displayed, the icon 603 in the first area is lit, and the first area is a trigger area where the obstacle climbs over. Taking fig. 6 as an example, when the virtual joystick is dragged from the second area 602 to an arbitrary position outside the second area, the first area is displayed on the game screen. In this embodiment, when the virtual stick is located in the second area, the movement direction of the virtual character may be controlled, and at this time, the determination area is not displayed in the game screen. And when the virtual rocker is dragged out of the second area, the first area is displayed in the game picture. Therefore, on one hand, the problem that a player is difficult to distinguish different icons due to the fact that various icons are displayed in a game picture can be avoided; on the other hand, when the virtual rocker is dragged out of the second area, the first area is displayed in the game picture, the player can be reminded of the position of the first area, and the player can conveniently control the virtual character to execute the action of crossing the barrier.

Optionally, after the virtual joystick is dragged from the second region to the first region, the method further comprises: canceling the display of the first area when the virtual joystick is dragged out of the first area.

As an optional embodiment, when the player drags the virtual joystick into the first region, it is determined whether the player virtual joystick stays in the first region, and at this time, when the virtual joystick is dragged out of the first region, the display of the first region is cancelled, that is, the icon of the first region is turned off, and at this time, the virtual corner controlled by the player continues to be kept in the current moving state in the game scene, for example, when the virtual character runs forward before the obstacle determination is performed, the action of running forward continues to be kept.

As an alternative implementation, fig. 7 is a schematic diagram of a one-handed operation according to an alternative embodiment of the invention. When the player drags the virtual stick 701 into the first area 703, it is determined whether an obstacle exists in front of the virtual character controlled by the player in the current game scene, and if it is determined that an obstacle exists, it is determined whether the obstacle is an obstacle that can be crossed, and if it is determined that the obstacle is a obstacle that can be crossed, the virtual character controlled by the player starts to perform an action of crossing the obstacle. If it is determined that the obstacle cannot be reversed or no obstacle exists, the virtual character controlled by the player continues to keep the current moving state in the game scene without executing the movement of reversing the obstacle, for example, if the virtual character is running forward before the obstacle determination, the virtual character continues to keep the movement of running forward and continues to detect whether or not the virtual stick moves into the first area. And if the player continues to drag the virtual joystick out of the first area, canceling the display of the first area in the game picture. As the player continues to drag the virtual rocker to the second region 702, the direction of movement of the virtual character, e.g., move forward, move left, move right, move back, etc., can be controlled by the position of the virtual rocker within the second region.

Optionally, the method further comprises: and in the process of moving the virtual character, if the virtual rocker is dragged to the first area and no obstacle exists in a certain range of the virtual character, controlling the virtual character to keep a current moving state.

As an alternative embodiment, the certain range may be preset, for example, 5 meters, 10 meters, 15 meters, and the like from the virtual character, and the specific preset range may be determined according to actual situations. The player can control the virtual rocker to move to the first area above the Y axis, after the virtual rocker moves to the first area, whether an obstacle exists in the preset range of the virtual character is judged, and if the obstacle exists, the virtual character is controlled to execute the action of crossing the obstacle. And if no obstacle exists, controlling the virtual character to continue executing the current moving state. For example, if the current movement state of the virtual character is forward running, the virtual character is controlled to continue the forward running.

Optionally, the detecting whether the obstacle exists within the preset range of the virtual character under the condition that the virtual joystick is located in the first area includes: and under the condition that the duration of the virtual rocker in the first area exceeds a first preset duration, detecting whether the barrier exists in the preset range of the virtual character.

As an optional implementation manner, if the virtual joystick is dragged to the first area, a duration of the virtual joystick located in the first area starts to be detected, and if the duration of the virtual joystick staying in the first area exceeds a preset duration, whether an obstacle exists in a preset range of the virtual character starts to be detected. The preset time period may be determined according to actual conditions, and may be, for example, 3 seconds, 4 seconds, 5 seconds, and the like.

If a player operates a virtual rocker through a touch mobile phone screen, the length of time that the fingers of the player press the virtual rocker for a long time needs to be judged, the long-time-based event of the player on the virtual rocker needs to be increased and monitored according to the length of time of a screen, and a calculation formula of the long-time-based screen length is as follows: the long screen pressing time length is equal to the time point of releasing the screen-the time point of pressing the screen, assuming that a first preset time length is set to be 0.3s, the time point of releasing the screen by the player is 18 hours, 30 minutes and 400 milliseconds, and the time point of pressing the screen is 18 hours, 30 minutes and 0 milliseconds, the long screen pressing time length is 18 hours, 30 minutes and 400 milliseconds, 18 hours, 30 minutes and 0 milliseconds, namely 400 milliseconds, and is correspondingly 0.4 seconds, when the long screen pressing time length monitoring detects that the time of pressing the screen by the parent is 0.4 seconds, namely exceeds the first preset time length and is 0.3s, the time length monitoring judgment is passed, and whether an obstacle exists in front of the virtual character controlled by the player in the current game scene is judged.

As an alternative embodiment, the virtual joystick is dragged into the first area, and starts to detect whether an obstacle exists within a preset range of the virtual character. The preset range may be determined according to actual conditions, for example, if the current motion state of the virtual character is moving forward, the preset range may be a preset distance in front of the virtual character, and may be, for example, 1 meter, 2 meters, and the like. Fig. 8 is a schematic diagram of obstacle detection according to an alternative embodiment of the present invention. Assuming that the preset range is 1 m away from the front of the virtual character, the virtual rocker is dragged to the first area, the virtual character keeps a forward moving motion state all the time, and whether an obstacle exists in the front 1 m of the virtual character is detected. And if the obstacle is not detected, controlling the virtual character to continuously execute the action of moving forwards. And if the obstacle is detected to exist in the range of 1 m in front of the virtual character, controlling the virtual character to execute the action of crossing the obstacle. In this embodiment, if there is no obstacle within the preset range of the virtual character, the virtual character continues to execute the current motion state, so that it is possible to prevent the virtual character from executing an invalid action of crossing the obstacle in the case where there is no obstacle, and to avoid the problem of excessive invalid operations in the game.

Optionally, the method further comprises: and in the process of controlling the virtual character to execute the action of crossing the obstacle, if the virtual rocker moves out of the first area, the virtual character is cancelled to execute the action of crossing the obstacle.

As an optional implementation manner, when the virtual joystick is dragged into the first region, whether an obstacle exists in a preset range is detected, and if the obstacle exists, the virtual joystick is controlled to execute an action of crossing the obstacle. If the virtual rocker moves out of the judgment area in the process that the virtual character crosses the obstacle, the action that the virtual character crosses the obstacle is cancelled, and the virtual obstacle keeps the motion state before crossing or stands still around the virtual obstacle. Fig. 9 is a schematic diagram of a game screen according to an alternative embodiment of the present invention, as shown in the figure, when the virtual joystick 900 is in the first area, if the virtual obstacle 902 is detected to be present within the preset range of the virtual character 901, the virtual character 901 is controlled to execute an action of crossing the obstacle 902. When the virtual stick 900 moves out of the determination area while the virtual character performs the action of crossing the obstacle 902, the virtual character 901 cancels the action of crossing the obstacle 902.

Optionally, the method further comprises: acquiring a setting instruction on a setting interface of the target game application; and responding to the setting instruction, setting the size of the first area according to the size indicated by the setting instruction, and setting the first area at the position indicated by the setting instruction.

As an optional implementation manner, before a player drags a virtual joystick to a first area to control a virtual character to cross an obstacle, related parameters of the first area need to be preset, the player can select to use or cancel the function as needed, and a setting interface of the first area can be operated by saving and exiting a touch control, as shown in fig. 10, which is a schematic diagram of a function setting interface according to an optional embodiment of the present invention, a function interface for setting the first area is opened in a setting system, the function interface includes a first area 1001 and a second area 1002, and dragging the first area and the second area can set positions of the first area and the second area in a game screen. The function interface further includes a parameter setting area 1003, which can set parameters such as size and color of the button in the judgment area. After the parameters and the position of the first area are set, the functions set for the first area can be used in the game application after the setting and the storage are finished.

As an alternative embodiment, the player may click into the settings interface in the lobby or in-game; opening a 'left-hand obstacle crossing' setting function page in a setting interface; after the function page with the left-hand obstacle-crossing setting function is opened, the player can enter the operation setting with the left-hand obstacle-crossing, adjust the specific size of the first area corresponding to the left-hand obstacle-crossing on the Y axis, and simultaneously adjust the specific position of the first area corresponding to the left-hand obstacle-crossing on the Y axis. After the adjustment of the size and the position of the first area corresponding to the left-hand obstacle crossing is completed, the touch control of the first area which is set by saving is clicked, and the touch control can take effect in the game; the player can realize one-hand (left-hand) operation to cross obstacles by dragging the position of the virtual rocker in the game; and during the crossing, the player can move out of the first area by using the finger to control the virtual rocker to cancel the crossing action.

Optionally, the controlling the direction in which the virtual character moves according to the position of the virtual joystick in the second area includes: under the condition that the virtual rocker is located at the left position in the second area, controlling the virtual character to move leftwards; under the condition that the virtual rocker is located at the right position in the second area, controlling the virtual character to move rightwards; under the condition that the virtual rocker is located at the upper position in the second area, controlling the virtual character to move forwards; and under the condition that the virtual rocker is positioned at the lower position in the second area, controlling the virtual character to move backwards.

As an alternative embodiment, a plurality of direction arrow marks may be provided at respective direction positions within the second area, and the marks are used for indicating the moving direction of the control virtual character. For example, an upper arrow mark is arranged above the second area, and if the virtual rocker is dragged to the upper arrow mark arranged at the upper position of the second area, the virtual character can be controlled to move forwards. If the virtual rocker is dragged to a left arrow mark arranged at the left position of the second area, the virtual character can be controlled to move leftwards. If the virtual rocker is dragged to be marked by a right arrow arranged at the right position of the second area, the virtual character can be controlled to move rightwards. If the virtual rocker is dragged to the position below the second virtual area, the virtual character can be controlled to move backwards.

Optionally, controlling the virtual character to perform an action of crossing the obstacle includes: controlling the virtual character to execute a target action corresponding to the type of the obstacle so that the virtual character climbs from one side of the obstacle to the other side of the obstacle, wherein the target action comprises a jumping action or a climbing action.

As an alternative embodiment, the virtual character may be controlled to perform the action of turning over the obstacle according to the type of the obstacle. Types of obstacles include, but are not limited to, boxes, fences, house windows, and the like. For smaller boxes, the avatar may cross the obstacle by jumping, crossing actions. For higher obstacles such as enclosing walls, house windows and the like, the virtual character can climb over the obstacles without limitation, and the virtual character can climb over the obstacles from one side of the obstacles to the other side of the obstacles according to the setting of an actual scene. In this embodiment, the actions performed by the virtual character may be controlled according to the type of the obstacle, simple climbing actions such as jumping may be performed for a small obstacle control virtual character, and difficult climbing actions may be performed for a large obstacle control virtual character. Therefore, the virtual character can be controlled to execute corresponding crossing actions according to the type of the barrier, the game scene is more fit with the actual scene, and the game experience effect of the player is improved.

As an alternative implementation, fig. 11 is an overall flowchart according to an alternative embodiment of the present invention, which includes the following steps:

in step S1101, the position of the virtual stick in the game screen is detected in the game scene. Specifically, the player can move the virtual joystick to any position in the game picture through dragging the virtual joystick, including but not limited to the judgment area, the second area, and any area outside the judgment area and the second area;

step S1102, determining whether the virtual joystick stays in the determination area and the duration of staying in the determination area. If the length of time that the virtual joystick stays in the determination region exceeds a predetermined length of time (which may be arbitrarily set, for example, 3 seconds), step S1103 is executed, and if the length of time that the virtual joystick stays in the determination region is less than the predetermined length of time, step S1109 is executed.

Step S1103, detecting whether the virtual character is an obstacle within a preset range, where the preset range may be determined according to an actual situation. For example, within a preset distance from the virtual character, the preset distance may be 3 meters, 5 meters, and the like, and may be set according to actual conditions.

In step S1104, if it is detected that an obstacle exists within the preset range of the virtual character, it is determined whether the obstacle can be crossed, if so, step S1105 is executed, otherwise, step S1109 is executed.

In step S1105, the virtual character is controlled to perform an action of crossing an obstacle, such as jumping or climbing.

Step S1106 continues to detect whether the virtual joystick stays in the determination area, and if the virtual joystick stays in the determination area, step S1107 is executed. If the virtual rocker does not stay in the determination area, go to step 1108.

In step S1107, the virtual character turns from one side of the obstacle to the other side after the turning action of the virtual character is completed.

In step S1108, the action of crossing the obstacle is cancelled, and the virtual character returns to the position before the obstacle is crossed.

Step S1109, the current motion state of the virtual character is continuously kept, and whether the virtual rocker stays in the preset judgment area is detected again.

It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.

According to another aspect of the embodiments of the present invention, there is also provided a control apparatus for a virtual character, which is used for implementing the control method for a virtual character. As shown in fig. 12, the apparatus includes: a display module 1202, configured to display a virtual role and a virtual joystick in a virtual scene, where the virtual role is a role controlled by a user; a first control module 1204, configured to control the virtual character to move in the virtual scene in response to an operation performed on the virtual joystick; the second control module 1206 is configured to, in a moving process of the virtual character, control the virtual character to execute an action of crossing over an obstacle if the virtual rocker is dragged to the first area and the obstacle exists within a certain range of the virtual character.

Optionally, the device is further configured to control a moving direction of the virtual character according to a position of the virtual joystick in the second area in response to an operation of dragging the virtual joystick to the second area.

Optionally, the apparatus is further configured to display the first area when the virtual joystick is dragged out of the second area; and acquiring the operation that the virtual rocker is dragged from the second area to the first area.

Optionally, the apparatus is further configured to cancel displaying the first area when the virtual joystick is dragged out of the first area after the virtual joystick is dragged from the second area to the first area.

Optionally, the device is further configured to, in a process of moving the virtual character, control the virtual character to maintain a current moving state if the virtual joystick is dragged to the first area and the obstacle does not exist within a certain range of the virtual character.

Optionally, the device is further configured to cancel controlling the virtual character to execute the action of crossing the obstacle if the virtual rocker moves out of the first area in the process of controlling the virtual character to execute the action of crossing the obstacle.

Optionally, the device is further configured to obtain a setting instruction on a setting interface of the target game application; and responding to the setting instruction, setting the size of the first area according to the size indicated by the setting instruction, and setting the first area at the position indicated by the setting instruction.

Optionally, the device is further configured to control the virtual character to move to the left if the virtual joystick is located at the left position in the second region; under the condition that the virtual rocker is located at the right position in the second area, controlling the virtual character to move rightwards; under the condition that the virtual rocker is located at the upper position in the second area, controlling the virtual character to move forwards; and under the condition that the virtual rocker is positioned at the lower position in the second area, controlling the virtual character to move backwards.

Optionally, the above apparatus is further configured to control the virtual character to perform a target action corresponding to the type of the obstacle, so that the virtual character climbs from one side of the obstacle to the other side of the obstacle, where the target action includes a jumping action or a climbing action.

According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the control method of the virtual character, where the electronic device may be the user equipment or the server shown in fig. 1. The present embodiment takes the electronic device as a server as an example for explanation. As shown in fig. 13, the electronic device comprises a memory 1302 and a processor 1304, wherein the memory 1302 stores a computer program, and the processor 1304 is configured to perform the steps of any of the above method embodiments by the computer program.

Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.

Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:

s1, displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user;

s2, displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user;

s3, in the moving process of the virtual character, if the virtual rocker is dragged to the first area and an obstacle exists in a certain range of the virtual character, controlling the virtual character to execute the action of crossing the obstacle.

Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 13 is only an illustration, and the electronic device may also be a user device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 13 is a diagram illustrating a structure of the electronic device. For example, the electronics may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 13, or have a different configuration than shown in FIG. 13.

The memory 1302 may be used to store software programs and modules, such as program instructions/modules corresponding to the virtual character control method and apparatus in the embodiments of the present invention, and the processor 1304 executes various functional applications and data processing by running the software programs and modules stored in the memory 1302, that is, the virtual character control method is implemented. The memory 1302 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1302 may further include memory located remotely from the processor 1304, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 1302 may be specifically, but not limited to, used for storing information such as game scenes, virtual characters, obstacles, and the like in the target game application. As an example, as shown in fig. 13, the memory 1302 may include, but is not limited to, a display module 1202, a first control module 1204, and a second control module 1206 of the control device of the virtual character. In addition, the control device may further include, but is not limited to, other module units in the control device of the virtual character, which is not described in detail in this example.

Optionally, the transmitting device 1306 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1306 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmitting device 1306 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.

In addition, the electronic device further includes: a display 1308 for displaying the above game scenes, virtual characters, obstacles, and the like; and a connection bus 1310 for connecting the respective module parts in the above-described electronic apparatus.

In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. Nodes can form a Peer-To-Peer (P2P, Peer To Peer) network, and any type of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the Peer-To-Peer network.

According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations described above. Wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.

Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:

s1, displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user;

s2, displaying a virtual role and a virtual rocker in a virtual scene, wherein the virtual role is a role controlled by a user;

s3, in the moving process of the virtual character, if the virtual rocker is dragged to the first area and an obstacle exists in a certain range of the virtual character, controlling the virtual character to execute the action of crossing the obstacle.

Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.

The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.

The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.

In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

25页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:游戏中的信息处理方法、装置、电子设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类