Method and device for controlling target virtual character in game

文档序号:791931 发布日期:2021-04-13 浏览:11次 中文

阅读说明:本技术 一种游戏中目标虚拟角色的控制方法及装置 (Method and device for controlling target virtual character in game ) 是由 黄海东 于 2020-12-28 设计创作,主要内容包括:本申请涉及游戏技术领域,尤其涉及一种游戏中目标虚拟角色的控制方法及装置。本申请通过响应作用在移动控件的拖动操作,控制目标虚拟角色移动,并在拖动操作进行的过程中,若在目标虚拟角色的攻击区域中存在敌方虚拟角色,则控制目标虚拟角色攻击该攻击区域中的敌方虚拟角色,其中,攻击区域是虚拟场景中在目标虚拟角色的目标攻击方向上的区域,目标攻击方向是由移动控件的初始位置和当前位置之间的相对位置确定的。这样,通过一个移动控件,实现对目标虚拟角色的移动路径、攻击时机以及攻击方向的控制,可以在降低玩家学习游戏操作成本的同时,保证游戏的操作深度,提升虚拟角色的可控性。(The present application relates to the field of game technologies, and in particular, to a method and an apparatus for controlling a target virtual character in a game. The method and the device control the target virtual character to move by responding to the dragging operation acted on the mobile control, and control the target virtual character to attack the enemy virtual character in the attack area if the enemy virtual character exists in the attack area of the target virtual character in the process of the dragging operation, wherein the attack area is the area in the target attack direction of the target virtual character in the virtual scene, and the target attack direction is determined by the relative position between the initial position and the current position of the mobile control. Therefore, the control of the moving path, the attack opportunity and the attack direction of the target virtual character is realized through the moving control, the operation cost of the player for learning the game can be reduced, the operation depth of the game can be ensured, and the controllability of the virtual character can be improved.)

1. A method for controlling a target virtual character in a game is applied to a terminal device, a mobile control and a virtual scene are displayed on a graphical user interface of the terminal device, the virtual scene comprises the target virtual character controlled by the mobile control, and the method comprises the following steps:

controlling the target virtual character to move in response to the dragging operation acted on the mobile control;

in the process of the dragging operation, if an enemy virtual character exists in an attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area;

wherein the attack area is an area in the virtual scene in a target attack direction of the target virtual character; the target attack direction is determined by a relative position between an initial position and a current position of the mobile control.

2. The control method according to claim 1, wherein if at least two enemy virtual characters exist in the attack area, the enemy virtual character with the smallest included angle between the target virtual character attack and the target attack direction is controlled.

3. The control method according to claim 1, wherein if at least two enemy virtual characters exist in the attack area and an included angle between each enemy virtual character and the target attack direction is the same, the enemy virtual character closest to the target virtual character is attacked by the target virtual character.

4. The control method according to claim 1, wherein if at least two enemy virtual characters exist in the attack area, the included angle between each enemy virtual character and the target attack direction is the same, and the distance between the target virtual character and each enemy virtual character is the same, the target virtual character is controlled to attack any one of the enemy virtual characters.

5. The control method according to claim 1, wherein the attack area is a sector area formed by taking the target virtual character as a circle center, a preset distance as a radius and a radiation included angle; the radiation included angle is a first angle of a difference value between a target angle and a preset angle and a second angle of a sum value between the target angle and the preset angle; the target angle is an angle corresponding to the target attack direction.

6. The method according to claim 1, wherein the target avatar is controlled to maintain a moving state if the enemy avatar does not exist in the attack area during the drag operation.

7. The method according to claim 1, wherein, in the process of the dragging operation, if an enemy virtual character exists in an attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area includes:

and in the process of the dragging operation, if an enemy virtual character exists in the attack area of the target virtual character, responding to the clicking operation acted on the mobile control, and controlling the target virtual character to attack the enemy virtual character.

8. The control method according to claim 7, characterized in that the click operation is determined to be valid in the following case:

the distance between the first position and the second position is less than a preset threshold;

the first position is the position where the mobile control is located before the click operation, and the second position is the position where the mobile control is located after the click operation.

9. A control device of a target virtual character in a game is applied to a terminal device, a mobile control and a virtual scene are displayed on a graphical user interface of the terminal device, the virtual scene comprises the target virtual character controlled by the mobile control, and the control device comprises:

the first control module is used for responding to the dragging operation acted on the mobile control and controlling the target virtual character to move;

a second control module, configured to, in a process of performing the dragging operation, if an enemy virtual character exists in an attack area of the target virtual character, control the target virtual character to attack the enemy virtual character in the attack area;

wherein the attack area is an area in the virtual scene in a target attack direction of the target virtual character; the target attack direction is determined by a relative position between an initial position and a current position of the mobile control.

10. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is running, the machine-readable instructions being executable by the processor to perform the steps of the method for controlling a target virtual character in a game as claimed in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, performs the steps of the method for controlling a target virtual character in a game according to any one of claims 1 to 8.

Technical Field

The present application relates to the field of game technologies, and in particular, to a method and an apparatus for controlling a target virtual character in a game.

Background

With the development of networks, more and more games emerge to players, and players can control target virtual characters to play games by operating virtual controls displayed on terminal devices, so that convenience of game operation plays a key role in game progress of players.

At present, in order to let the player learn the game operation and reduce the learning cost, the attack direction is usually removed and changed into default attack, and only the player is provided with the movement operation, so that the operation mode loses a certain game operation depth and the controllability of the virtual character is deteriorated.

Disclosure of Invention

In view of this, embodiments of the present disclosure provide a method and an apparatus for controlling a target virtual character in a game, which can reduce the cost of a player for learning the game operation, ensure the operation depth of the game, and improve the controllability of the virtual character.

The application mainly comprises the following aspects:

in a first aspect, an embodiment of the present application provides a method for controlling a target virtual character in a game, where the method is applied to a terminal device, a mobile control and a virtual scene are displayed on a graphical user interface of the terminal device, and the virtual scene includes the target virtual character controlled by the mobile control, and the method includes:

controlling the target virtual character to move in response to the dragging operation acted on the mobile control;

in the process of the dragging operation, if an enemy virtual character exists in an attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area;

wherein the attack area is an area in the virtual scene in a target attack direction of the target virtual character; the target attack direction is determined by a relative position between an initial position and a current position of the mobile control.

In a possible implementation manner, if at least two enemy virtual characters exist in the attack area, the enemy virtual character with the smallest included angle between the target virtual character attack and the target attack direction is controlled.

In a possible implementation manner, if at least two enemy virtual characters exist in the attack area and the included angle between each enemy virtual character and the target attack direction is the same, the target virtual character is controlled to attack the enemy virtual character closest to the target virtual character.

In a possible implementation manner, if at least two enemy virtual characters exist in the attack area, the included angle between each enemy virtual character and the target attack direction is the same, and the distance between each target virtual character and each enemy virtual character is the same, the target virtual character is controlled to attack any one enemy virtual character.

In a possible implementation manner, the attack area is a sector area formed by taking the target virtual character as a circle center, a preset distance as a radius and a radiation included angle; the radiation included angle is a first angle of a difference value between a target angle and a preset angle and a second angle of a sum value between the target angle and the preset angle; the target angle is an angle corresponding to the target attack direction.

In a possible implementation manner, during the dragging operation, if the enemy virtual character does not exist in the attack area, the target virtual character is controlled to keep a moving state.

In a possible implementation manner, if an enemy virtual character exists in an attack area of the target virtual character during the dragging operation, controlling the target virtual character to attack the enemy virtual character in the attack area includes:

and in the process of the dragging operation, if an enemy virtual character exists in the attack area of the target virtual character, responding to the clicking operation acted on the mobile control, and controlling the target virtual character to attack the enemy virtual character.

In one possible embodiment, the click operation is determined to be valid in the following case:

the distance between the first position and the second position is less than a preset threshold;

the first position is the position where the mobile control is located before the click operation, and the second position is the position where the mobile control is located after the click operation.

In a second aspect, an embodiment of the present application further provides a device for controlling a target virtual character in a game, which is applied to a terminal device, where a mobile control and a virtual scene are displayed on a graphical user interface of the terminal device, and the virtual scene includes the target virtual character controlled by the mobile control, where the device for controlling a target virtual character in a game includes:

the first control module is used for responding to the dragging operation acted on the mobile control and controlling the target virtual character to move;

a second control module, configured to, in a process of performing the dragging operation, if an enemy virtual character exists in an attack area of the target virtual character, control the target virtual character to attack the enemy virtual character in the attack area;

wherein the attack area is an area in the virtual scene in a target attack direction of the target virtual character; the target attack direction is determined by a relative position between an initial position and a current position of the mobile control.

In a possible implementation manner, if at least two virtual characters of the enemy exist in the attack area, the second control module is further configured to control the virtual character of the enemy with the smallest included angle between the target virtual character attack and the target attack direction.

In a possible implementation manner, if at least two enemy virtual characters exist in the attack area and the included angle between each enemy virtual character and the target attack direction is the same, the second control module is further configured to control the target virtual character to attack the enemy virtual character closest to the target virtual character.

In a possible implementation manner, if at least two enemy virtual characters exist in the attack area, the included angle between each enemy virtual character and the target attack direction is the same, and the distance between each target virtual character and each enemy virtual character is the same, the second control module is further configured to control the target virtual character to attack any one of the enemy virtual characters.

In a possible implementation manner, the attack area is a sector area formed by taking the target virtual character as a circle center, a preset distance as a radius and a radiation included angle; the radiation included angle is a first angle of a difference value between a target angle and a preset angle and a second angle of a sum value between the target angle and the preset angle; the target angle is an angle corresponding to the target attack direction.

In a possible implementation manner, the second control module is further configured to, during the dragging operation, control the target avatar to keep moving if the enemy avatar does not exist in the attack area.

In one possible embodiment, the control device further comprises:

and the third control module is used for controlling the target virtual character to attack the enemy virtual character if the enemy virtual character exists in the attack area of the target virtual character and responds to the click operation acted on the mobile control in the process of the dragging operation.

In one possible embodiment, the click operation is determined to be valid in the following case:

the distance between the first position and the second position is less than a preset threshold;

the first position is the position where the mobile control is located before the click operation, and the second position is the position where the mobile control is located after the click operation.

In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, when the electronic device runs, the processor and the memory communicate with each other through the bus, and when the processor runs, the machine-readable instructions perform the steps of the method for controlling a target virtual character in a game according to the first aspect or any one of the possible embodiments of the first aspect.

In a fourth aspect, the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for controlling a target virtual character in a game according to the first aspect or any one of the possible implementation manners of the first aspect are executed.

According to the control method and device for the target virtual character in the game, the moving path, the attack opportunity and the attack direction of the target virtual character are controlled through the moving control, compared with the prior art that in order to enable a player to learn game operation and reduce learning cost, the attack direction is usually removed and changed into default attack, and only the moving operation is provided for the player, in such an operation mode, a certain game operation depth is lost, and the controllability of the virtual character is poor, the game operation cost of the player can be reduced, meanwhile, the operation depth of the game is ensured, and the controllability of the virtual character is improved.

Further, the method for controlling the target virtual character in the game provided by the embodiment of the application can respond to the click operation acting on the mobile control, and if the enemy virtual character exists in the attack area, the target virtual character is controlled to attack the enemy virtual character, so that the attack on the enemy virtual character can be realized by controlling the mobile control, and the cost on the game operation can be reduced.

In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.

FIG. 1 is a flow chart illustrating a method for controlling a target virtual character in a game according to an embodiment of the present application;

FIG. 2 shows one of the graphical user interface diagrams when controlling a target avatar action;

FIG. 3 illustrates a second graphical user interface diagram for controlling the actions of the target avatar;

FIG. 4 is a functional block diagram of a control apparatus for a target virtual character in a game according to an embodiment of the present application;

FIG. 5 is a second functional block diagram of a control device for a target virtual character in a game according to an embodiment of the present application;

fig. 6 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.

Description of the main element symbols:

in the figure: 400-control means of a target virtual character in the game; 410-a first control module; 420-a second control module; 430-a third control module; 600-an electronic device; 610-a processor; 620-memory; 630-bus.

Detailed Description

To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be performed in reverse order or concurrently. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.

In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.

To enable those skilled in the art to utilize the present disclosure, the following embodiments are presented in conjunction with a specific application scenario, "in-game avatar control," for which it would be apparent to those skilled in the art that the general principles defined herein may be applied to other embodiments and application scenarios without departing from the spirit and scope of the present disclosure.

The method, apparatus, electronic device or computer-readable storage medium described in the embodiments of the present application may be applied to any scenario in which virtual character control in a game needs to be performed, and the embodiments of the present application do not limit a specific application scenario, and any scheme using the method and apparatus for virtual character control in a game provided in the embodiments of the present application is within the scope of protection of the present application.

It should be noted that, before the present application is proposed, some shooting-based leisure games have the advantages that in order to enable a player to learn the operation of the game, the attack direction is removed, the target specified by the attack system is changed to the default target, only the player is provided with a moving operation, and the attack operation requires the player to stop moving the virtual control before the player can default the attack.

In view of the above problems, in the embodiment of the present application, a target virtual character is controlled to move by responding to a dragging operation acting on a mobile control, and in a process of the dragging operation, if an enemy virtual character exists in an attack area of the target virtual character, the target virtual character is controlled to attack the enemy virtual character in the attack area, where the attack area is an area in a target attack direction of the target virtual character in a virtual scene, and the target attack direction is determined by a relative position between an initial position and a current position of the mobile control. Therefore, the control of the moving path, the attack time and the attack direction of the target virtual character is realized through the moving control, the game operation mode is simplified, the operation cost of a player for learning the game operation is reduced, the operation depth of the game is ensured, and the controllability of the virtual character is improved.

It should be noted that, a user who uses the terminal device to perform a game operation is a player, and the player can operate the graphical user interface of the terminal.

For the convenience of understanding of the present application, the technical solutions provided in the present application will be described in detail below with reference to specific embodiments.

Fig. 1 is a flowchart of a method for controlling a target virtual character in a game according to an embodiment of the present application. As shown in fig. 1, a method for controlling a target virtual character in a game provided in an embodiment of the present application is applied to a terminal device, a mobile control and a virtual scene are displayed on a graphical user interface of the terminal device, and the virtual scene includes the target virtual character controlled by the mobile control, and the method includes the following steps:

s101: and controlling the target virtual character to move in response to the dragging operation acted on the mobile control.

In a specific implementation, a player can control a target virtual character by operating a mobile control displayed in a graphical user interface of a terminal device, where the player can control the movement of the target virtual character when dragging the mobile control, and specifically, when the terminal device detects a dragging operation acting on the mobile control, the terminal device controls the movement of the target virtual character, and can control the movement direction of the target virtual character according to the dragging direction of the dragging operation, and control the movement distance of the target virtual character according to the dragging force and the dragging distance of the dragging operation.

Here, the terminal device has a graphical user interface for displaying a game screen, where a movement control and a virtual scene are displayed on the graphical user interface, and a target virtual character controlled by the movement control is in the virtual scene.

It should be noted that the movement control moves within the movement area, the movement area is an area of the virtual scene, the shape of the movement area may be a circular area or other shapes, and the movement area may be displayed or not displayed. The initial position of the movement control is the center of the movement area. The initial position of the movement control may or may not be fixed at a fixed location on the graphical user interface.

S102: and in the process of the dragging operation, if an enemy virtual character exists in the attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area.

Wherein the attack area is an area in the virtual scene in a target attack direction of the target virtual character; the target attack direction is determined by a relative position between an initial position and a current position of the mobile control.

In a specific implementation, in a process of dragging a mobile control in a graphical user interface by a player, at this time, a target virtual character is in a mobile state, and if an enemy virtual character exists in an attack area of the target virtual character at this time, the target virtual character can be automatically controlled to attack the enemy virtual character in the attack area. Here, the attack area of the target virtual character is an area in the target attack direction in the virtual scene, that is, the attack area is determined by the target attack direction and the position of the target virtual character, wherein the target attack direction is determined by the relative position between the initial position and the current position of the mobile control, the initial position of the mobile control is the center position of the mobile area, and the direction of a connection line from the initial position to the current position can be determined as the target attack direction.

Here, the enemy virtual character may be a virtual character controlled by an enemy player, or may be a monster, a soldier, or the like of the enemy player.

It should be noted that, by operating the mobile control provided by the present application, the movement of the target virtual character, including the direction and distance of movement, may be controlled, in the process of dragging the mobile control to control the movement of the target virtual character, attack may be performed on the enemy virtual character in the attack area, and the attack direction may be controlled by the dragging position of the mobile control, that is, by using one mobile control, the control of the movement path, attack timing and attack direction of the target virtual character may be realized, and while the cost of the player learning the game operation may be reduced, because the movement, attack and attack direction of the target virtual character may be controlled, the operation depth of the game may be ensured, and the degree of controllability of the target virtual character may be improved. The game operation mode can greatly reduce the game threshold, thereby improving the popularity of the game and absorbing more players.

Further, two or more enemy virtual characters may exist in the attack area at the same time, and at this time, the enemy virtual character to be attacked by the target virtual character needs to be determined according to a certain judgment condition, that is, if at least two enemy virtual characters exist in the attack area, the enemy virtual character with the smallest included angle between the target virtual character attack and the target attack direction is controlled.

In the specific implementation, in the process of performing the dragging operation, that is, in the process of dragging the mobile control, if at least two enemy virtual characters exist in the attack area of the target virtual character, an included angle between a connection line between the position of each enemy virtual character and the target attack direction is determined, the included angle is determined as the included angle between the enemy virtual character and the target attack direction, and further, the enemy virtual character with the smallest included angle between the target virtual character attack and the target attack direction is controlled, that is, the target virtual character is controlled to attack the enemy virtual character closer to the target attack direction. Therefore, the game control is more logical, and the immersion of the player is improved.

Further, two or more enemy virtual characters may exist in the attack area at the same time, and the included angles between the enemy virtual characters and the target attack direction are the same, at this time, the enemy virtual character to be attacked by the target virtual character needs to be determined according to a certain judgment condition, that is, if at least two enemy virtual characters exist in the attack area and the included angles between each enemy virtual character and the target attack direction are the same, the target virtual character is controlled to attack the enemy virtual character closest to the target virtual character.

In the specific implementation, in the process of performing the dragging operation, that is, in the process of dragging the mobile control, if at least two enemy virtual characters exist in the attack area of the target virtual character, and an included angle between a connection line between the position of each enemy virtual character and the target attack direction is determined to be the same, here, the included angle is determined to be the included angle between the enemy virtual character and the target attack direction, further, the distance between each enemy virtual character and the target virtual character is determined, and the enemy virtual character with the closest distance to the target virtual character is attacked by the target virtual character, that is, the enemy virtual character with the closest distance to the target virtual character is controlled to attack. Of course, the distance to the virtual character of the enemy may be determined first, and the size of the included angle may be determined again when the distances are the same. Therefore, the game control is more logical, and the immersion of the player is improved.

Further, two or more enemy virtual characters may exist in the attack area at the same time, and the included angle between each enemy virtual character and the target attack direction is the same, and the distance between each target virtual character and each enemy virtual character is also the same, at this time, the enemy virtual character to be attacked by the target virtual character needs to be determined according to a certain judgment condition, that is, if at least two enemy virtual characters exist in the attack area, the included angle between each enemy virtual character and the target attack direction is the same, and the distance between each target virtual character and each enemy virtual character is the same, the target virtual character is controlled to attack any one of the enemy virtual characters. Therefore, the game control is more logical, and the immersion of the player is improved.

In the specific implementation, in the process of performing the dragging operation, that is, in the process of dragging the mobile control, if at least two enemy virtual characters exist in the attack area of the target virtual character, and the included angle between the connection line between the position where each enemy virtual character is located and the target virtual character and the target attack direction is determined to be the same, and the distance between the target virtual character and each enemy virtual character is also determined to be the same, here, the included angle is determined to be the included angle between the enemy virtual character and the target attack direction, and further, the target virtual character can be controlled to attack any one enemy virtual character, that is, an attack enemy virtual character is selected.

It should be noted that, if two or more enemy virtual characters are located at the same position or located at a close distance, the target virtual character may be controlled to attack the at least two or more enemy virtual characters at the same time.

Further, the attack area may be an area corresponding to the target attack direction, where the shape of the attack area is not limited, and preferably, the attack area may be set as a sector area formed by taking the target virtual character as a center of a circle, a preset distance as a radius, and a radiation included angle, where the radiation included angle is a first angle of a difference between the target angle and the preset angle, and an included angle between the target angle and a second angle of a sum of the preset angle, and the target angle is an angle corresponding to the target attack direction.

In specific implementation, the attack range of the target virtual character can be determined by taking the target virtual character as a circle center and taking a preset distance as a radius, the attack range is a range of distances which can be attacked by the target virtual character and is limited, wherein the attack range is a circular area, a sector area formed by a radiation included angle is determined from the attack range, and the sector area is determined as the attack area of the target virtual character. Here, the target angle is an angle corresponding to the target attack direction, that is, the target angle is an included angle between a horizontal direction (which may be a vertical direction or other reference direction) and the target attack direction, and the radiation included angle is an included angle between a first angle and a second angle, where the first angle is a difference between the target angle and a preset angle, and the second angle is a sum of the target angle and the preset angle, and the preset angle may be set according to actual needs of the game, and is generally set to an angle smaller than 30 degrees. The sector area formed by the radiation included angle is used as an attack area, the areas close to the target attack direction can be used as attack areas, and the attack range of the target virtual character can be expanded.

In an example, the target angle corresponding to the target attack direction is 30 degrees, the preset angle is 15 degrees, the first angle is 30-15 degrees, the second angle is 30+15 degrees, the radiation angle is 15 degrees and 45 degrees, the angle between 15 degrees and 45 degrees and the circular region may enclose a sector region, and then the attack region is obtained.

As shown in fig. 2, fig. 2 shows one of the graphic user interface diagrams when the control target virtual character acts. A mobile control and a virtual scene are displayed on the graphical user interface shown in fig. 2, and a target virtual character controlled by the mobile control is in the virtual scene, where a circular area in the virtual scene is an attack range of the target virtual character, a sector area is an attack area of the target virtual character, and an area surrounding the mobile control is a mobile area.

Further, in the process of the dragging operation, the attack area of the target virtual character does not necessarily have an enemy virtual character, and a case that no enemy virtual character exists in the attack area is explained below, that is, if the enemy virtual character does not exist in the attack area, the target virtual character is controlled to keep a moving state.

In a specific implementation, if an enemy virtual character does not exist in an attack area of a target virtual character in the process of dragging the mobile control by a player, the target virtual character is controlled to keep a mobile state, wherein the moving distance and the moving direction of the target virtual character are both controlled by the mobile control, and specifically, the moving direction of the target virtual character can be controlled according to the dragging direction of the dragging operation, and the moving distance of the target virtual character can be controlled according to the dragging force and/or the dragging distance of the dragging operation.

Further, in addition to controlling the target virtual character to automatically attack the enemy virtual character when the enemy virtual character exists in the attack area of the target virtual character in the process of dragging the mobile control, a player can actively trigger an attack, and the situation of actively triggering the attack is explained below, that is, in the process of dragging, if the enemy virtual character exists in the attack area, the target virtual character is controlled to attack the enemy virtual character in response to the clicking operation acted on the mobile control.

In specific implementation, when the click operation acting on the mobile control is detected and an enemy virtual character exists in the attack area of the target virtual character, the target virtual character can be controlled to attack the enemy virtual character. Here, the target virtual character can be controlled to attack by clicking the mobile control, and no matter what state the mobile control is in, the attack operation can be executed, for example, when the mobile control is dragged, the target virtual character can still be controlled to execute the attack operation by clicking the mobile control, so that one mobile control can control the moving, attacking and attacking directions of the target virtual character, the control degree of the target virtual character can be improved, and the depth of the game operation can be improved.

Here, if the attack area has no enemy avatar, the target avatar may be controlled to attack in the target attack direction, or may be controlled not to attack.

It should be noted that, each time the mobile control is clicked, the target virtual character may initiate an attack, and if the mobile control is clicked continuously, the target virtual character may be controlled to continuously attack the virtual character of the enemy.

As shown in fig. 3, fig. 3 is a second graphical user interface diagram for controlling the action of the target avatar. A mobile control and a virtual scene are displayed on the graphical user interface shown in fig. 3, a target virtual character controlled by the mobile control is in the virtual scene, wherein a circular area in the virtual scene is an attack range of the target virtual character, and the target virtual character can be controlled to attack by clicking the mobile control.

Further, when it is detected that the player touches the mobile control, it is necessary to detect whether the touch operation is a click operation, and determine whether the click operation is valid, and only when the click operation is valid, the target virtual character is controlled to attack, so that it is possible to avoid a situation that the target virtual character is controlled to attack by a misoperation of the player, and whether the attack operation is valid is explained below, that is, it is determined that the click operation is valid under the following situations: the distance between the first position and the second position is less than a preset threshold; the first position is the position where the mobile control is located before the click operation, and the second position is the position where the mobile control is located after the click operation.

In specific implementation, if it is determined that the distance between the position of the mobile control before the click operation and the position of the mobile control after the click operation is smaller than a preset threshold, it may be determined that the click operation is valid; if the distance between the position of the mobile control before the click operation and the position of the mobile control after the click operation is larger than or equal to the preset threshold value, the click operation can be determined to be invalid. And controlling the target virtual character to attack only when the clicking operation is effective, otherwise, not controlling the target virtual character to attack. The preset threshold value can be set according to the size of the mobile control, and can be set to a value smaller than 0.5 cm.

In the embodiment of the application, the target virtual character is controlled to move by responding to the dragging operation acted on the mobile control, and in the process of the dragging operation, if the enemy virtual character exists in the attack area of the target virtual character, the target virtual character is controlled to attack the enemy virtual character in the attack area, wherein the attack area is an area in the target attack direction of the target virtual character in the virtual scene, and the target attack direction is determined by the relative position between the initial position and the current position of the mobile control. Therefore, the control of the moving path, the attack opportunity and the attack direction of the target virtual character is realized through the moving control, the operation cost of the player for learning the game can be reduced, the operation depth of the game can be ensured, and the controllability of the virtual character can be improved.

Based on the same application concept, the embodiment of the present application further provides a device for controlling a target virtual character in a game corresponding to the method for controlling a target virtual character in a game provided in the foregoing embodiment, and as the principle of solving the problem of the device in the embodiment of the present application is similar to the method for controlling a target virtual character in a game provided in the foregoing embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.

As shown in fig. 4 and 5, fig. 4 is one of functional block diagrams of a control apparatus 400 for a target virtual character in a game according to an embodiment of the present application, and fig. 5 is a second of the functional block diagrams of the control apparatus 400 for a target virtual character in a game according to an embodiment of the present application.

As shown in fig. 4, a control apparatus 400 for a target virtual character in a game is applied to a terminal device, a mobile control and a virtual scene are displayed on a graphical user interface of the terminal device, the virtual scene includes the target virtual character controlled by the mobile control, and the control apparatus 400 for the target virtual character in the game includes:

a first control module 410, configured to control the target virtual character to move in response to a dragging operation applied to the movement control;

a second control module 420, configured to, in a process of performing the dragging operation, if an enemy virtual character exists in an attack area of the target virtual character, control the target virtual character to attack the enemy virtual character in the attack area;

wherein the attack area is an area in the virtual scene in a target attack direction of the target virtual character; the target attack direction is determined by a relative position between an initial position and a current position of the mobile control.

In a possible implementation manner, as shown in fig. 4, if at least two enemy virtual characters exist in the attack area, the second control module 420 is further configured to control the enemy virtual character with the smallest included angle between the target virtual character attack and the target attack direction.

In a possible implementation manner, as shown in fig. 4, if at least two enemy virtual characters exist in the attack area and an included angle between each enemy virtual character and the target attack direction is the same, the second control module 420 is further configured to control the enemy virtual character closest to the target virtual character to attack the target virtual character.

In a possible implementation manner, as shown in fig. 4, if at least two enemy virtual characters exist in the attack area, and an included angle between each enemy virtual character and the target attack direction is the same, and a distance between the target virtual character and each enemy virtual character is the same, the second control module 420 is further configured to control the target virtual character to attack any one of the enemy virtual characters.

In a possible implementation manner, the attack area is a sector area formed by taking the target virtual character as a circle center, a preset distance as a radius and a radiation included angle; the radiation included angle is a first angle of a difference value between a target angle and a preset angle and a second angle of a sum value between the target angle and the preset angle; the target angle is an angle corresponding to the target attack direction.

In a possible implementation manner, as shown in fig. 4, the second control module 420 is further configured to, during the dragging operation, control the target avatar to keep moving if the enemy avatar does not exist in the attack area.

In one possible embodiment, as shown in fig. 5, the control device 400 for the target virtual character in the game further includes:

and a third control module 430, configured to, in the process of performing the dragging operation, respond to a click operation applied to the mobile control if an enemy virtual character exists in the attack area of the target virtual character, and control the target virtual character to attack the enemy virtual character.

In one possible embodiment, the click operation is determined to be valid in the following case:

the distance between the first position and the second position is less than a preset threshold;

the first position is the position where the mobile control is located before the click operation, and the second position is the position where the mobile control is located after the click operation.

In the embodiment of the application, the target virtual character is controlled to move by responding to the dragging operation acted on the mobile control, and in the process of the dragging operation, if the enemy virtual character exists in the attack area of the target virtual character, the target virtual character is controlled to attack the enemy virtual character in the attack area, wherein the attack area is an area in the target attack direction of the target virtual character in the virtual scene, and the target attack direction is determined by the relative position between the initial position and the current position of the mobile control. Therefore, the control of the moving path, the attack opportunity and the attack direction of the target virtual character is realized through the moving control, the operation cost of the player for learning the game can be reduced, the operation depth of the game can be ensured, and the controllability of the virtual character can be improved.

Based on the same application concept, referring to fig. 6, a schematic structural diagram of an electronic device 600 provided in the embodiment of the present application includes: a processor 610, a memory 620 and a bus 630, wherein the memory 620 stores machine-readable instructions executable by the processor 610, when the electronic device 600 runs, the processor 610 and the memory 620 communicate with each other through the bus 630, and the machine-readable instructions are executed by the processor 610 to perform the steps of the method for controlling a target avatar in a game according to any of the above embodiments.

In particular, the machine readable instructions, when executed by the processor 610, may perform the following:

controlling the target virtual character to move in response to the dragging operation acted on the mobile control;

in the process of the dragging operation, if an enemy virtual character exists in an attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area;

wherein the attack area is an area in the virtual scene in a target attack direction of the target virtual character; the target attack direction is determined by a relative position between an initial position and a current position of the mobile control.

In the embodiment of the application, the target virtual character is controlled to move by responding to the dragging operation acted on the mobile control, and in the process of the dragging operation, if the enemy virtual character exists in the attack area of the target virtual character, the target virtual character is controlled to attack the enemy virtual character in the attack area, wherein the attack area is an area in the target attack direction of the target virtual character in the virtual scene, and the target attack direction is determined by the relative position between the initial position and the current position of the mobile control. Therefore, the control of the moving path, the attack opportunity and the attack direction of the target virtual character is realized through the moving control, the operation cost of the player for learning the game can be reduced, the operation depth of the game can be ensured, and the controllability of the virtual character can be improved.

Based on the same application concept, embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for controlling a target virtual character in a game provided by the above embodiments are executed.

Specifically, the storage medium can be a general storage medium, such as a removable disk, a hard disk, and the like, when a computer program on the storage medium is run, the method for controlling the target virtual character in the game can be executed, and the control over the movement path, the attack timing, and the attack direction of the target virtual character is realized through a mobile control, so that the operation cost of the game learned by the player can be reduced, the operation depth of the game can be ensured, and the controllability of the virtual character can be improved.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or 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 of devices or units through some communication interfaces, and may be in an electrical, mechanical 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 enemy, 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 application 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 functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:云游戏直播过程中转移游戏控制权的方法、系统和设备

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!

技术分类