A method and device for controlling a target virtual character in a game
By using mobile controls to control the movement and attack of target virtual characters in the game, the problem of reducing operation depth caused by the removal of attack direction in the prior art is solved, and the controllability of virtual characters and the operation logic of the game is improved.
Patent Information
- Application Number
- CN202011581392.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2040-12-28
AI Technical Summary
In the existing game operation mode, in order to reduce the player's learning cost, the attack direction is usually removed and changed to the default attack, resulting in the reduction of the game operation depth and the controllability of virtual characters becomes worse.
By displaying the mobile controls on the graphical user interface of the terminal device, controlling the movement of the target virtual character in response to the drag operation, and automatically attacking the enemy virtual character in the attack area. The initial and current position of the mobile control determines the attack direction to achieve the target Control of the movement path, attack timing and attack direction of the virtual character.
While reducing the cost of players learning game operations, it improves the depth of game operations and the controllability of virtual characters, and enhances the logic and immersion of the game operations.
Smart Images

Figure CN112642152B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of game technology, and in particular to a method and device for controlling a target virtual character in a game. Background Art
[0002] With the development of the Internet, more and more games are emerging in front of players. Players can control the target virtual character to play the game by operating the virtual controls displayed on the terminal device. Therefore, the convenience of game operation plays a key role in the player's gaming progress.
[0003] At present, in order to enable players to learn game operations and reduce learning costs, the attack direction is usually removed and replaced with a default attack, while only movement operations are provided to players. This operation method loses a certain depth of game operation and the controllability of virtual characters becomes worse. Summary of the invention
[0004] In view of this, the embodiments of the present application at least provide a method and device for controlling a target virtual character in a game, which can reduce the cost of players learning game operations while ensuring the operational depth of the game and improving the controllability of the virtual character.
[0005] This application mainly includes the following aspects:
[0006] In a first aspect, an embodiment of the present application provides a method for controlling a target virtual character in a game, which is applied to a terminal device, wherein a mobile control and a virtual scene are displayed on a graphical user interface of the terminal device, and the virtual scene includes a target virtual character controlled by the mobile control, and the control method includes:
[0007] In response to a drag operation on the mobile control, controlling the movement of the target virtual character;
[0008] During the dragging operation, if there is an enemy virtual character in the attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area;
[0009] The attack area is an area in the virtual scene in the target attack direction of the target virtual character; the target attack direction is determined by the relative position between the initial position and the current position of the mobile control.
[0010] In a possible implementation, if there are at least two enemy virtual characters in the attack area, the target virtual character is controlled to attack the enemy virtual character having the smallest angle with the target attack direction.
[0011] In a possible implementation, if there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, the target virtual character is controlled to attack the enemy virtual character that is closest to the target virtual character.
[0012] In a possible implementation, if there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, and the distances between the target virtual character and each of the enemy virtual characters are the same, then the target virtual character is controlled to attack any one of the enemy virtual characters.
[0013] In a possible implementation, the attack area is a fan-shaped area with the target virtual character as the center, a preset distance as the radius, and a radiation angle; the radiation angle is the angle between a first angle that is the difference between a target angle and a preset angle, and a second angle that is the sum of the target angle and the preset angle; the target angle is the angle corresponding to the target attack direction.
[0014] 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 moving.
[0015] In a possible implementation, during the dragging operation, if there is an enemy virtual character in the attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area includes:
[0016] During the dragging operation, if there is an enemy virtual character in the attack area of the target virtual character, in response to a click operation on the mobile control, the target virtual character is controlled to attack the enemy virtual character.
[0017] In a possible implementation manner, the click operation is determined to be valid in the following cases:
[0018] The distance between the first position and the second position is less than a preset threshold;
[0019] The first position is the position of the mobile control before the click operation, and the second position is the position of the mobile control after the click operation.
[0020] In a second aspect, an embodiment of the present application further provides a control device for a target virtual character in a game, which is applied to a terminal device, wherein a mobile control and a virtual scene are displayed on a graphical user interface of the terminal device, wherein the virtual scene includes a target virtual character controlled by the mobile control, and the control device includes:
[0021] A first control module, configured to control the movement of the target virtual character in response to a drag operation on the mobile control;
[0022] A second control module is used for controlling the target virtual character to attack the enemy virtual character in the attack area if there is an enemy virtual character in the attack area of the target virtual character during the dragging operation;
[0023] The attack area is an area in the virtual scene in the target attack direction of the target virtual character; the target attack direction is determined by the relative position between the initial position and the current position of the mobile control.
[0024] In a possible implementation, if there are at least two enemy virtual characters in the attack area, the second control module is further configured to control the target virtual character to attack the enemy virtual character having the smallest angle with the target attack direction.
[0025] In a possible implementation, if there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, the second control module is further used to control the target virtual character to attack the enemy virtual character that is closest to the target virtual character.
[0026] In a possible implementation, if there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, and the distances between the target virtual character and each of the enemy virtual characters are the same, the second control module is further used to control the target virtual character to attack any of the enemy virtual characters.
[0027] In a possible implementation, the attack area is a fan-shaped area with the target virtual character as the center, a preset distance as the radius, and a radiation angle; the radiation angle is the angle between a first angle that is the difference between a target angle and a preset angle, and a second angle that is the sum of the target angle and the preset angle; the target angle is the angle corresponding to the target attack direction.
[0028] In a possible implementation manner, the second control module is further configured to control the target virtual character to keep moving if the enemy virtual character does not exist in the attack area during the dragging operation.
[0029] In a possible implementation manner, the control device further includes:
[0030] The third control module is used to control the target virtual character to attack the enemy virtual character in response to a click operation on the mobile control if there is an enemy virtual character in the attack area of the target virtual character during the dragging operation.
[0031] In a possible implementation manner, the click operation is determined to be valid in the following cases:
[0032] The distance between the first position and the second position is less than a preset threshold;
[0033] The first position is the position of the mobile control before the click operation, and the second position is the position of the mobile control after the click operation.
[0034] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the method for controlling a target virtual character in a game described in the first aspect or any possible implementation manner of the first aspect.
[0035] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for controlling a target virtual character in a game as described in the first aspect or any possible implementation manner of the first aspect are executed.
[0036] The control method and device for the target virtual character in the game provided by the embodiment of the present application use a mobile control to control the movement path, attack timing and attack direction of the target virtual character. Compared with the prior art, in order to enable players to learn game operations and reduce learning costs, the attack direction is usually removed and replaced with a default attack, and only movement operations are provided to players. This operation method loses a certain game operation depth and the controllability of the virtual character becomes worse. This method can reduce the cost of players learning game operations while ensuring the game operation depth and improving the controllability of the virtual character.
[0037] Furthermore, the control method of the target virtual character in the game provided by the embodiment of the present application can also respond to a click operation on the mobile control. If there is an enemy virtual character in the attack area, the target virtual character is controlled to attack the enemy virtual character. In this way, the attack on the enemy virtual character can be achieved by controlling the mobile control, which can reduce the cost of game operation.
[0038] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A flow chart showing a method for controlling a target virtual character in a game provided by an embodiment of the present application is shown;
[0041] Figure 2 One of the schematic diagrams of the graphical user interface for controlling the actions of the target virtual character is shown;
[0042] Figure 3 A second schematic diagram of a graphical user interface for controlling the actions of a target virtual character is shown;
[0043] Figure 4 One of the functional module diagrams of a control device for a target virtual character in a game provided by an embodiment of the present application is shown;
[0044] Figure 5 A second functional module diagram of a control device for a target virtual character in a game provided by an embodiment of the present application is shown;
[0045] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.
[0046] Description of main component symbols:
[0047] In the figure: 400 - a control device for a target virtual character in a game; 410 - a first control module; 420 - a second control module; 430 - a third control module; 600 - an electronic device; 610 - a processor; 620 - a memory; 630 - a bus. DETAILED DESCRIPTION
[0048] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0049] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0050] In order to enable those skilled in the art to use the contents of this application, the following implementation methods are given in combination with the specific application scenario of "controlling virtual characters in games". For those skilled in the art, the general principles defined here can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.
[0051] The following methods, devices, electronic devices or computer-readable storage media of the embodiments of the present application can be applied to any scenario requiring control of a virtual character in a game. The embodiments of the present application are not limited to specific application scenarios. Any scheme using the virtual character control method and device provided in the embodiments of the present application is within the scope of protection of the present application.
[0052] It is worth noting that before the present application was filed, some casual shooting games, in order to allow players to learn how to operate the game, removed the attack direction and changed it to a default attack on the target specified by the system, and only provided players with movement operations. The attack operation required the player to stop moving the virtual controls before the default attack. The advantage of such a setting is that the player's learning cost for the operation is low, but the player can only control the movement direction of the virtual character. Such a game operation setting loses a certain operational depth, the controllability of the virtual character becomes worse, and the attack behavior and direction are not controlled by the player, resulting in low adaptability of the interactive scenes set by the game operation.
[0053] In view of the above problems, the embodiment of the present application controls the movement of the target virtual character by responding to the drag operation acting on the mobile control, and during the drag operation, if there is an enemy virtual character 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 the area in the virtual scene in the target attack direction of the target virtual character, and the target attack direction is determined by the relative position between the initial position and the current position of the mobile control. In this way, the control of the moving path, attack timing and attack direction of the target virtual character is achieved through a mobile control, which simplifies the game operation method, can reduce the cost of players learning game operations, ensure the depth of game operation, and improve the controllability of virtual characters.
[0054] It should be noted that the user who uses the terminal device to operate the game is the player, and the player can operate the graphical user interface of the terminal.
[0055] To facilitate the understanding of the present application, the technical solution provided by the present application is described in detail below in conjunction with specific embodiments.
[0056] Figure 1 This is a flow chart of a method for controlling a target virtual character in a game provided by an embodiment of the present application. Figure 1 As shown, the control method of the target virtual character in the game provided by the embodiment of the present application is applied to a terminal device, and a mobile control and a virtual scene are displayed on the graphical user interface of the terminal device. The virtual scene contains a target virtual character controlled by the mobile control. The control method includes the following steps:
[0057] S101: In response to a drag operation on the mobile control, the target virtual character is controlled to move.
[0058] In a specific implementation, the player can control the target virtual character by operating the mobile control displayed in the graphical user interface of the terminal device. Here, when the player drags the mobile control, the movement of the target virtual character can be controlled. Specifically, when the terminal device detects a drag operation acting on the mobile control, the target virtual character can be controlled to move. The direction of the target virtual character's movement can be controlled according to the dragging direction of the dragging operation, and the distance of the target virtual character's movement can be controlled according to the dragging strength and dragging distance of the dragging operation.
[0059] Here, the terminal device has a graphical user interface, and the graphical user interface is used to display the game screen. Here, the graphical user interface displays mobile controls and a virtual scene, and the virtual scene contains a target virtual character controlled by the mobile controls.
[0060] It should be noted that the mobile control moves in the mobile area, which is an area of the virtual scene. The shape of the mobile area can be a circular area or other shapes. The mobile area can be displayed or not. The initial position of the mobile control is the center of the mobile area. The initial position of the mobile control can be located at a fixed position of the graphical user interface or not.
[0061] S102: During the dragging operation, if there is an enemy virtual character in the attack area of the target virtual character, control the target virtual character to attack the enemy virtual character in the attack area.
[0062] The attack area is an area in the virtual scene in the target attack direction of the target virtual character; the target attack direction is determined by the relative position between the initial position and the current position of the mobile control.
[0063] In a specific implementation, when the player drags the mobile control in the graphical user interface, the target virtual character is in a moving state. If there is an enemy virtual character in the attack area of the target virtual character, 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 jointly 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 moving area, and the direction of the line from the initial position to the current position can be determined as the target attack direction.
[0064] Here, the enemy virtual character may be a virtual character controlled by an enemy player, or may be a monster, a soldier, etc. of the enemy player.
[0065] 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, can be controlled. In the process of dragging the mobile control to control the movement of the target virtual character, the enemy virtual character in the attack area can be attacked, and the attack direction can be controlled by the drag position of the mobile control, that is, through a mobile control, the movement path, attack timing and attack direction of the target virtual character can be controlled. While reducing the cost of learning game operations for players, since the movement, attack and attack direction of the target virtual character can be controlled, the operation depth of the game can be guaranteed, and the controllability of the target virtual character can be improved. Such a game operation mode can greatly reduce the threshold of the game, thereby increasing the popularity of the game and attracting more players.
[0066] Furthermore, there may be two or more enemy virtual characters in the attack area at the same time. At this time, it is necessary to determine the enemy virtual character that the target virtual character is to attack according to certain judgment conditions, that is, if there are at least two enemy virtual characters in the attack area, the target virtual character is controlled to attack the enemy virtual character with the smallest angle between the attack direction of the target.
[0067] In a specific implementation, during the drag operation, that is, during the dragging of the mobile control, if there are at least two enemy virtual characters in the attack area of the target virtual character, the angle between the line between the position of each enemy virtual character and the target virtual character and the target attack direction is determined, and the angle is determined as the angle between the enemy virtual character and the target attack direction, and then the target virtual character is controlled to attack the enemy virtual character with the smallest angle between the target attack direction, that is, the target virtual character is controlled to attack the enemy virtual character that is closer to the target attack direction. In this way, the game control can be made more logical and the player's immersion can be enhanced.
[0068] Furthermore, there may be two or more enemy virtual characters in the attack area at the same time, and the angles between these enemy virtual characters and the target attack direction are the same. At this time, it is necessary to determine the enemy virtual character that the target virtual character is to attack according to certain judgment conditions, that is, if there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, then the target virtual character is controlled to attack the enemy virtual character that is closest to the target virtual character.
[0069] In a specific implementation, during the drag operation, that is, during the dragging of the mobile control, if there are at least two enemy virtual characters in the attack area of the target virtual character, and it is determined that the angle between the position of each enemy virtual character and the line connecting the target virtual character and the target attack direction is the same, here, the angle is determined as the angle between the enemy virtual character and the target attack direction, and further, the distance between each enemy virtual character and the target virtual character is determined, and the target virtual character is controlled to attack the enemy virtual character closest to the target virtual character, that is, the target virtual character is controlled to attack the enemy virtual character closest to it. Of course, the distance to the enemy virtual character can also be determined first, and then the size of the above angle can be determined when the distance is the same. In this way, the game control can be made more logical and the player's immersion can be enhanced.
[0070] Furthermore, there may be two or more enemy virtual characters in the attack area at the same time, and the angles between these enemy virtual characters and the target attack direction are the same, and the distances between the target virtual character and each enemy virtual character are also the same. At this time, it is necessary to determine the enemy virtual character to be attacked by the target virtual character according to certain judgment conditions, that is, if there are at least two enemy virtual characters in the attack area, and the angles between each enemy virtual character and the target attack direction are the same, and the distances between the target virtual character and each enemy virtual character are the same, then the target virtual character is controlled to attack any of the enemy virtual characters. In this way, the game control can be made more logical and the player's immersion can be enhanced.
[0071] In a specific implementation, during the dragging operation, that is, during the dragging of the mobile control, if there are at least two enemy virtual characters in the attack area of the target virtual character, and it is determined that the angle between the line between the position of each enemy virtual character and the target virtual character and the target attack direction is the same, and the distance between the target virtual character and each enemy virtual character is also the same, here, the angle is determined as the angle between the enemy virtual character and the target attack direction, and further, the target virtual character can be controlled to attack any one of the enemy virtual characters, that is, choose one to attack the enemy virtual character.
[0072] It should be noted that if there are two or more enemy virtual characters in the same position, or in positions close to each other, the target virtual character may be controlled to attack the at least two or more enemy virtual characters at the same time.
[0073] Furthermore, the attack area can be an area corresponding to the target attack direction. Here, the shape of the attack area is not limited. Preferably, the attack area can be set to a fan-shaped area with the target virtual character as the center, the preset distance as the radius, and a radiation angle, wherein the radiation angle is the angle between a first angle that is the difference between the target angle and the preset angle, and a second angle that is the sum of the target angle and the preset angle, and the target angle is the angle corresponding to the target attack direction.
[0074] In a specific implementation, the target virtual character can be taken as the center of the circle and the preset distance as the radius to determine the attack range of the target virtual character. The attack range is to limit the distance range that the target virtual character can attack. Here, the attack range is a circular area, and the fan-shaped area formed by the radiation angle is determined from the attack range, and the fan-shaped area is determined as the attack area of the target virtual character. Here, the target angle is the angle corresponding to the target attack direction, that is, the target angle is the angle between the horizontal direction (it can also be the vertical direction or other reference direction) and the target attack direction, and the radiation angle is the angle between the first angle and the second angle, wherein the first angle is the difference between the target angle and the preset angle, and the second angle is the sum of the target angle and the preset angle. The preset angle can be set according to the actual needs of the game, and is generally set to an angle less than 30 degrees. By using the fan-shaped area formed by the radiation angle as the attack area, the area close to the target attack direction can be used as the attack area, and the attack range of the target virtual character can be expanded.
[0075] In one example, the target angle corresponding to the target attack direction is 30 degrees, and the preset angle is 15 degrees. The first angle is 30-15=15 degrees, and the second angle is 30+15=45 degrees. The radiation angle is the angle between 15 degrees and 45 degrees. The angle between 15 degrees and 45 degrees and the circular area can form a fan-shaped area, and then the attack area is obtained.
[0076] like Figure 2 As shown, Figure 2 One of the schematic diagrams of the graphical user interface for controlling the actions of a target virtual character is shown. Figure 2 The graphical user interface shown in the figure displays mobile controls and a virtual scene, in which there is a target virtual character controlled by the mobile controls, wherein the circular area in the virtual scene is the attack range of the target virtual character, the fan-shaped area is the attack area of the target virtual character, and the area surrounding the mobile controls is the moving area.
[0077] Furthermore, during the dragging operation, there may not necessarily be an enemy virtual character in the attack area of the target virtual character. The following describes the situation where there is no enemy virtual character in the attack area. That is, if there is no enemy virtual character in the attack area, the target virtual character is controlled to keep moving.
[0078] In a specific implementation, if there is no enemy virtual character in the attack area of the target virtual character while the player is dragging the mobile control, the target virtual character is controlled to keep moving, wherein the moving distance and moving direction of the target virtual character are controlled by the mobile control. 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 dragging distance of the dragging operation.
[0079] Furthermore, in addition to being able to control the target virtual character to automatically attack the enemy virtual character when there is an enemy virtual character in the attack area of the target virtual character during the process of dragging the mobile control, the player can also actively trigger an attack. The situation of actively triggering an attack is explained below, that is, during the dragging operation, if there is an enemy virtual character in the attack area, in response to a click operation on the mobile control, the target virtual character is controlled to attack the enemy virtual character.
[0080] In a specific implementation, when a click operation on a 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 on the mobile control. The attack operation can be performed regardless of the state of the mobile control. For example, when the mobile control is being dragged, clicking on the mobile control can still control the target virtual character to perform the attack operation. In this way, a mobile control can control the movement, attack and attack direction of the target virtual character, which can improve the degree of control over the target virtual character and increase the depth of the game operation.
[0081] Here, if there is no enemy virtual character in the attack area, the target virtual character can be controlled to attack in the target attack direction, or the target virtual character can be controlled not to attack.
[0082] It should be noted that each time the mobile control is clicked, the target virtual character will launch an attack. If the mobile control is clicked continuously, the target virtual character can be controlled to attack the enemy virtual character continuously.
[0083] like Figure 3 As shown, Figure 3 A second schematic diagram of a graphical user interface for controlling the actions of a target virtual character is shown. Figure 3 The graphical user interface shown in the figure displays a mobile control and a virtual scene. In the virtual scene, there is a target virtual character controlled by the mobile control. The circular area in the virtual scene is the attack range of the target virtual character. By clicking the mobile control, the target virtual character can be controlled to attack.
[0084] Furthermore, 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. Only when the click operation is valid will the target virtual character be controlled to attack. In this way, it can be avoided that the target virtual character is controlled to attack due to the player's misoperation. The following explains whether the attack operation is valid, that is, in the following case, it is determined that the click operation is valid: the distance between the first position and the second position is less than a preset threshold; wherein the first position is the position of the mobile control before the click operation, and the second position is the position of the mobile control after the click operation.
[0085] In a 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 less than a preset threshold, it can be determined that the click operation is valid; 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 greater than or equal to the preset threshold, it can be determined that the click operation is invalid. Only when the click operation is valid can the target virtual character be controlled to attack, otherwise, the target virtual character cannot be controlled to attack. Among them, the preset threshold can be set according to the size of the mobile control, and a value less than 0.5 cm can be set.
[0086] In the embodiment of the present application, the target virtual character is controlled to move by responding to the drag operation on the mobile control, and during the drag operation, if there is an enemy virtual character 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. In this way, the control of the moving path, attack timing and attack direction of the target virtual character is achieved through a mobile control, which can reduce the cost of players learning game operations while ensuring the depth of game operations and improving the controllability of the virtual character.
[0087] Based on the same application concept, the embodiment of the present application also provides a control device for the target virtual character in the game corresponding to the control method for the target virtual character in the game provided in the above embodiment. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the control method for the target virtual character in the game in the above embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0088] like Figure 4 , Figure 5 As shown, Figure 4 This is one of the functional module diagrams of a control device 400 for a target virtual character in a game provided by an embodiment of the present application. Figure 5This is a second functional module diagram of a control device 400 for a target virtual character in a game provided in an embodiment of the present application.
[0089] like Figure 4 As shown, a control device 400 for a target virtual character in a game is applied to a terminal device, and a graphical user interface of the terminal device displays a mobile control and a virtual scene, and the virtual scene contains a target virtual character controlled by the mobile control. The control device 400 for the target virtual character in the game includes:
[0090] A first control module 410, configured to control the movement of the target virtual character in response to a drag operation on the mobile control;
[0091] A second control module 420 is used for controlling the target virtual character to attack the enemy virtual character in the attack area if there is an enemy virtual character in the attack area of the target virtual character during the dragging operation;
[0092] The attack area is an area in the virtual scene in the target attack direction of the target virtual character; the target attack direction is determined by the relative position between the initial position and the current position of the mobile control.
[0093] In a possible implementation, Figure 4 As shown, if there are at least two enemy virtual characters in the attack area, the second control module 420 is further used to control the target virtual character to attack the enemy virtual character with the smallest angle between the target attack direction and the target virtual character.
[0094] In a possible implementation, Figure 4 As shown, if there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, the second control module 420 is also used to control the target virtual character to attack the enemy virtual character that is closest to the target virtual character.
[0095] In a possible implementation, Figure 4 As shown, if there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, and the distances between the target virtual character and each of the enemy virtual characters are the same, the second control module 420 is also used to control the target virtual character to attack any of the enemy virtual characters.
[0096] In a possible implementation, the attack area is a fan-shaped area with the target virtual character as the center, a preset distance as the radius, and a radiation angle; the radiation angle is the angle between a first angle that is the difference between a target angle and a preset angle, and a second angle that is the sum of the target angle and the preset angle; the target angle is the angle corresponding to the target attack direction.
[0097] In a possible implementation, Figure 4 As shown, the second control module 420 is further used to control the target virtual character to keep moving if the enemy virtual character does not exist in the attack area during the dragging operation.
[0098] In a possible implementation, Figure 5 As shown, the control device 400 of the target virtual character in the game also includes:
[0099] The third control module 430 is used to control the target virtual character to attack the enemy virtual character in response to a click operation on the mobile control if there is an enemy virtual character in the attack area of the target virtual character during the dragging operation.
[0100] In a possible implementation manner, the click operation is determined to be valid in the following cases:
[0101] The distance between the first position and the second position is less than a preset threshold;
[0102] The first position is the position of the mobile control before the click operation, and the second position is the position of the mobile control after the click operation.
[0103] In the embodiment of the present application, the target virtual character is controlled to move by responding to the drag operation on the mobile control, and during the drag operation, if there is an enemy virtual character 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. In this way, the control of the moving path, attack timing and attack direction of the target virtual character is achieved through a mobile control, which can reduce the cost of players learning game operations while ensuring the depth of game operations and improving the controllability of the virtual character.
[0104] Based on the same application concept, see Figure 6As shown, it is a structural schematic diagram of an electronic device 600 provided in an embodiment of the present application, including: a processor 610, a memory 620 and a bus 630, the memory 620 stores machine-readable instructions executable by the processor 610, when the electronic device 600 is running, the processor 610 and the memory 620 communicate through the bus 630, and the machine-readable instructions are executed by the processor 610 when running to perform the steps of the control method of the target virtual character in the game as described in any of the above embodiments.
[0105] Specifically, when the machine-readable instruction is executed by the processor 610, the following processing may be performed:
[0106] In response to a drag operation on the mobile control, controlling the movement of the target virtual character;
[0107] During the dragging operation, if there is an enemy virtual character in the attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area;
[0108] The attack area is an area in the virtual scene in the target attack direction of the target virtual character; the target attack direction is determined by the relative position between the initial position and the current position of the mobile control.
[0109] In the embodiment of the present application, the target virtual character is controlled to move by responding to the drag operation on the mobile control, and during the drag operation, if there is an enemy virtual character 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. In this way, the control of the moving path, attack timing and attack direction of the target virtual character is achieved through a mobile control, which can reduce the cost of players learning game operations while ensuring the depth of game operations and improving the controllability of the virtual character.
[0110] Based on the same application concept, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the control method of the target virtual character in the game provided in the above embodiment are executed.
[0111] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, it can execute the control method of the target virtual character in the above-mentioned game. Through a mobile control, the movement path, attack timing and attack direction of the target virtual character can be controlled. While reducing the cost of players learning game operations, it can ensure the operation depth of the game and improve the controllability of the virtual character.
[0112] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one party or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0114] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0115] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0116] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for controlling a target virtual character in a game, characterized in that: Applied to a terminal device, a graphical user interface of the terminal device displays a mobile control and a virtual scene, the virtual scene includes a target virtual character controlled by the mobile control, and the control method includes: In response to a drag operation on the mobile control, controlling the movement of the target virtual character; During the dragging operation, if there is an enemy virtual character in the attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area; During the dragging operation, if the enemy virtual character does not exist in the attack area, controlling the target virtual character to keep moving; The attack area is an area in the virtual scene in the target attack direction of the target virtual character; the target attack direction is determined by the relative position between the initial position and the current position of the mobile control.
2. The control method according to claim 1, characterized in that: If there are at least two enemy virtual characters in the attack area, the target virtual character is controlled to attack the enemy virtual character with the smallest angle between the target attack direction and the target virtual character.
3. The control method according to claim 1, characterized in that: If there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, the target virtual character is controlled to attack the enemy virtual character that is closest to the target virtual character.
4. The control method according to claim 1, characterized in that: If there are at least two enemy virtual characters in the attack area, and the angles between each of the enemy virtual characters and the target attack direction are the same, and the distances between the target virtual character and each of the enemy virtual characters are the same, then the target virtual character is controlled to attack any one of the enemy virtual characters.
5. The control method according to claim 1, characterized in that: The attack area is a fan-shaped area with the target virtual character as the center, a preset distance as the radius, and a radiation angle; the radiation angle is the angle between a first angle that is the difference between a target angle and a preset angle, and a second angle that is the sum of the target angle and the preset angle; the target angle is the angle corresponding to the target attack direction.
6. The control method according to claim 1, characterized in that: During the dragging operation, if there is an enemy virtual character in the attack area of the target virtual character, controlling the target virtual character to attack the enemy virtual character in the attack area includes: During the dragging operation, if there is an enemy virtual character in the attack area of the target virtual character, in response to a click operation on the mobile control, the target virtual character is controlled to attack the enemy virtual character.
7. The control method according to claim 6, characterized in that: The click operation is determined to be valid in the following cases: The distance between the first position and the second position is less than a preset threshold; The first position is the position of the mobile control before the click operation, and the second position is the position of the mobile control after the click operation.
8. A control device for a target virtual character in a game, characterized in that: Applied to a terminal device, a graphical user interface of the terminal device displays a mobile control and a virtual scene, the virtual scene contains a target virtual character controlled by the mobile control, and the control device includes: A first control module, configured to control the movement of the target virtual character in response to a drag operation on the mobile control; A second control module is used for controlling the target virtual character to attack the enemy virtual character in the attack area if there is an enemy virtual character in the attack area of the target virtual character during the dragging operation; The second control module is further configured to control the target virtual character to keep moving if the enemy virtual character does not exist in the attack area during the dragging operation; The attack area is an area in the virtual scene in the target attack direction of the target virtual character; the target attack direction is determined by the relative position between the initial position and the current position of the mobile control.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the machine-readable instructions are executed by the processor to execute the steps of the method for controlling a target virtual character in a game as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for controlling a target virtual character in a game as described in any one of claims 1 to 7 are executed.
