Virtual character control method and device of game, electronic equipment and storage medium
By integrating multiple interactive control areas into the portrait-oriented game interface, the problem of single-dimensional operation in portrait-oriented games is solved, and the convenience and fun of multi-dimensional control are improved, adapting to the screen characteristics of mobile devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU AIYOU INFORMATION TECH
- Filing Date
- 2026-03-26
- Publication Date
- 2026-05-15
AI Technical Summary
Vertical games suffer from limited control options and low convenience, especially on mobile devices where complex multi-dimensional operations are difficult to support.
The attack control area, movement operation controls, attack direction controls, and attack intensity display area are integrated into the same interactive control area in the vertical screen game interface. The target control strategy of the virtual character is determined by touch operation, including the target attack intensity, target attack direction, and target movement direction, and is visualized through the attack intensity display area.
It improves the convenience and richness of virtual character control, enhances the game's strategy and fun, reduces the learning cost for players, and adapts to the narrow screen width of mobile devices.
Smart Images

Figure CN122032087A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of game development technology, and in particular to a method, apparatus, electronic device, and computer-readable storage medium for controlling virtual characters in a game. Background Technology
[0002] With the widespread adoption of mobile devices, vertical games have gained an increasing share in the mobile game market due to their advantages such as being suitable for one-handed operation and occupying reasonable visual space. The rationality and convenience of the operation scheme have become core factors affecting the experience of vertical games.
[0003] However, vertical scrolling games are limited by the narrow horizontal width of mobile device screens, and players generally use a one-handed operation mode, resulting in many limitations in the operation design of existing vertical games, making it difficult to support complex multi-dimensional operations. Currently, solutions to this problem mainly fall into two categories: one is to automate non-essential operations, retaining only the core decision-related operation interface. This approach greatly simplifies the game's operation dimensions but sacrifices the game's depth and fun. The other is to set non-essential operations as secondary operations, hiding them when not necessary and only displaying them under specific conditions. While this solution saves operation space to some extent, the switching process between multiple levels of operations is cumbersome, increasing the complexity and learning cost for players, and it cannot achieve parallel execution of multi-dimensional operations, seriously affecting the game's smoothness.
[0004] Therefore, the current methods for controlling virtual characters in vertical games suffer from limited operational dimensions and low convenience. Summary of the Invention
[0005] Therefore, it is necessary to provide a virtual character control method, device, electronic device, and storage medium that offers rich operational dimensions and convenience, addressing at least one of the aforementioned technical problems.
[0006] In a first aspect, embodiments of this disclosure provide a method for controlling a virtual character in a game, the method comprising the following steps: displaying an interactive control area in a portrait-oriented game interface, responding to a touch operation applied to the interactive control area, and determining a target control strategy corresponding to the virtual character based on the touch operation, so that the virtual character can implement the target control strategy.
[0007] The vertical screen game interface is provided by the terminal device. The interactive control area includes an inner attack control area, a middle movement operation control and attack direction control, and an outer attack strength display area. The target control strategy includes target attack strength, target attack direction and / or target movement direction. The target attack strength is visualized by the attack strength display area.
[0008] In some embodiments, responding to a touch operation applied to the interactive control area and determining the target control strategy corresponding to the virtual character based on the touch operation may include the following steps: In response to the press start event in the attack control area, initialize the current attack force and start the timer to obtain the press duration; The current attack power is updated frame by frame based on the duration of the press and the charging speed of the virtual character. The current attack strength is simultaneously output to the attack strength display area for visual display; In response to the press-to-end event acting on the attack control area, stop the timer and determine the current attack strength data as the target attack strength.
[0009] In some embodiments, the interactive control area further includes a cancel attack zone, and the virtual character control method may further include the following steps: Determine whether the release operation position corresponding to the press end event is within the attack cancellation zone; When the release position is outside the attack cancellation zone, control the virtual character to perform an attack with the target attack force; The attack operation is canceled when the release position is within the attack cancellation zone.
[0010] In some embodiments, the virtual character control method may further include the following steps: In response to the press start event in the attack control area, the charge intensity change flag is set to the increased state; When the current attack power reaches the preset full power threshold, the charge power change marker will be switched to a decreasing state; The current attack power can be updated frame by frame based on the duration of the press and the charging speed of the virtual character. This can include updating the current attack power frame by frame based on the duration of the press, the charging speed of the virtual character, and the charging power change marker.
[0011] In some embodiments, the movement control includes a left movement sub-control and a right movement sub-control symmetrically distributed on the left and right sides of the attack control area.
[0012] Responding to touch operations applied to the interactive control area, and determining the target control strategy corresponding to the virtual character based on the touch operation, may include: responding to a press start event applied to a left-moving sub-control or a right-moving sub-control, and determining the corresponding target movement direction.
[0013] The virtual character control method may also include the following steps: in response to a press start event, controlling the virtual character to move toward the target movement direction; in response to a press end event, controlling the virtual character to stop moving.
[0014] In some embodiments, the attack direction control includes an attack direction increase control and an attack direction decrease control respectively distributed on the top and bottom sides of the interactive control area.
[0015] Responding to touch operations applied to the interactive control area and determining the target control strategy corresponding to the virtual character based on the touch operation may include the following steps: In response to a press start event applied to the attack direction increase control or attack direction decrease control, determine the corresponding attack direction change flag, start a timer to count down, and obtain the duration of the attack direction press. The attack angle change rate is determined based on the preset base attack angle change rate and the character bonus parameters corresponding to the virtual character. The target attack direction of the virtual character is determined based on the speed of change of attack angle, the attack direction change marker, and the duration of the attack direction press.
[0016] The attack direction change markers include a direction increase marker corresponding to the attack direction increase control and a direction decrease marker corresponding to the attack direction decrease control.
[0017] In some embodiments, the touch operation includes at least one of single-point pressing, multi-point pressing, and long-press dragging, and the interactive control area is located in the lower central area of the portrait screen game interface to adapt to the one-handed operation coverage of the terminal device.
[0018] In a second aspect, embodiments of this disclosure provide a virtual character control device for implementing the virtual character control method of the game as described above; the device includes: an interactive control area display module and a target control strategy determination module.
[0019] The interactive control area display module is used to display the interactive control area in the portrait-oriented game interface, which is provided by the terminal device. The interactive control area includes an inner attack control area, a middle movement operation control and attack direction control, and an outer attack intensity display area.
[0020] The target control strategy determination module is used to respond to touch operations applied to the interactive control area, and determine the target control strategy corresponding to the virtual character based on the touch operation, so that the virtual character can implement the target control strategy.
[0021] The target control strategy includes target attack intensity, target attack direction and / or target movement direction, with the target attack intensity being visualized in the attack intensity display area.
[0022] In a third aspect, embodiments of this disclosure provide an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the virtual character control method provided in any embodiment of the first aspect of this disclosure.
[0023] In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the virtual character control method provided in any embodiment of the first aspect of the present disclosure.
[0024] The aforementioned virtual character control method, device, electronic device, and storage medium integrate the attack control area, movement control, attack direction control, and attack power display area into a single interactive control area within a vertical screen game interface through a multi-layered distribution. This adapts to the narrow horizontal width of mobile terminal screens, solving the problems of scattered control controls and difficulty in one-handed coverage in traditional solutions. Players can perform multi-dimensional control without switching control areas, improving the convenience of virtual character control. Simultaneously, by responding to touch operations applied to the interactive control area, the target control strategy for the virtual character is determined. This allows players to trigger one or more operations within the same interactive control area, such as moving the virtual character, adjusting the attack direction, or accumulating attack power, significantly enriching the player's touch operation dimensions and enhancing the game's strategy and fun.
[0025] In addition, the attack power is visualized through the attack power display area, allowing players to perceive changes in attack power in real time and accurately control the rhythm of operation. The operation controls are arranged in layers according to function, with clear logic, which conforms to the operating habits of one-handed thumb and reduces the learning cost for players. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating the virtual character control method in some embodiments of the game; Figure 2 This is a schematic diagram showing the distribution of the interactive control area in some embodiments; Figure 3 This is a schematic diagram showing the distribution of the interactive control area in some other embodiments; Figure 4 A schematic diagram illustrating the process of determining the target control strategy corresponding to the attack control region in some embodiments; Figure 5 This is a schematic diagram showing the distribution of the interactive control area in some other embodiments. Figure 6 This is a schematic diagram illustrating the target control strategy determination process corresponding to the attack direction control in some embodiments. Figure 7This is a structural block diagram of the virtual character control device in some embodiments; Figure 8 This is a diagram of the internal structure of an electronic device in some embodiments. Detailed Implementation
[0027] To make the technical solutions and advantages of this disclosure clearer, the embodiments and related technical content of this disclosure will be further described in detail below with reference to the accompanying drawings and text description. It should be understood that the embodiments described below are only used to explain the technical solutions of the embodiments of this disclosure and are not intended to limit more possible implementations of this disclosure.
[0028] It should be noted that relational terms such as "first" and "second" appearing in this document are used only to distinguish things, states, or actions, and do not necessarily indicate or imply relative importance or order. The terms "including," "comprising," or any other variations thereof are used to indicate non-exclusive inclusion, and the included objects may not be limited to those listed in this document. The terms "multiple" or other variations are used to indicate that the number of objects is two or more.
[0029] In a first aspect, embodiments of this disclosure provide a method for controlling a virtual character in a game. In some embodiments, such as Figure 1 As shown, the virtual character control method includes steps S101 and S102. These steps can be performed by the client running the game; each step is described in detail below.
[0030] Step S101: Display the interactive control area in the portrait-oriented game interface.
[0031] The vertical screen game interface is provided by the terminal device, and the interactive control area includes an inner attack control area, a middle movement operation control and attack direction control, and an outer attack intensity display area.
[0032] In some specific examples, the interactive control area can be as follows: Figure 2 As shown. The interactive control area 210 is located in the lower middle area of the portrait game interface 200. The interactive control area 210 includes an attack control area 211, a movement operation control 212, an attack direction control 213, and an attack power display area 214.
[0033] Specifically, the attack control area 211 can be the innermost area of the interactive control area 210, and its visual presentation can be circular, square, elliptical, or other shapes. The movement control 212 can be distributed on the left and right sides of the attack control area 211, and the attack direction control 213 can be distributed on the top and bottom sides of the attack control area 211. The movement control 212 and attack direction control 213 are distributed in the middle layer of the interactive control area 210, and their visual presentation can be triangular, rhomboid, circular, or other shapes. The attack strength display area 214 is located on the outermost layer of the interactive control area 210, and can be distributed at the top of the attack control area 211. Its visual presentation can be rectangular, rounded rectangle, or fan-shaped, or it can be a complete ring shape surrounding the movement control 212 and attack direction control 213. No particular restrictions are placed on the visual presentation of each area or control within the interactive control area; those skilled in the art can set it according to actual layout needs. Each area or control can take the form of virtual buttons, touch areas, skill button areas, or other forms.
[0034] In some specific examples, portrait-oriented game interfaces can also be like... Figure 3 As shown. Among them, the visual presentation effect of the attack strength display area 214 adopts a fan-shaped ring.
[0035] Step S102: Respond to the touch operation applied to the interactive control area, determine the target control strategy corresponding to the virtual character based on the touch operation, so that the virtual character can implement the target control strategy.
[0036] The target control strategy includes at least one of the following: target attack intensity, target attack direction, and target movement direction. The target attack intensity is visualized in the attack intensity display area.
[0037] Touch operations refer to the touch-related actions performed by players using their fingers on the screen of a terminal device (such as a mobile phone). This is the physical way players transmit commands to the game, specifically including actions such as "pressing," "swiping," "long-pressing," and "releasing" with the player's fingers on the interactive control area. Virtual characters are digital representations (such as people, animals, or items) controlled by the player in the game scene, and are the main entities executing the target control strategy. The target control strategy can be a set of specific operation instructions that the virtual character needs to execute, derived from the player's touch operations.
[0038] In some specific examples, the target control strategy can include a combination of one or more of the following: target attack strength, target attack direction, and target movement direction. For example, the target control strategy could be: "Move left + Attack upwards + Strength 80". The target attack strength can be a quantified value (force parameter) determined by the player's touch input when the virtual character launches an attack. The target attack direction can be the angle or orientation of the attack initiated by the virtual character, determined by the player's touch input. The target movement direction can be the orientation of the virtual character's movement within the game scene, determined by the player's touch input. The attack strength display area is used to visually present the target attack strength, and can be displayed using a progress bar or a color-coded range bar.
[0039] Specifically, in response to touch operations applied to the interactive control area, a target control strategy corresponding to the virtual character is determined based on the touch position, touch duration, and / or touch pressure corresponding to the touch operation. After determining the target control strategy, it is sent to the virtual character's behavior control module to drive the virtual character to perform actions matching the target control strategy in the virtual scene, thereby enabling users to control the virtual character in real time and accurately through touch operations.
[0040] In some specific examples, the virtual character control method further includes the following step: controlling the virtual character to perform the operation corresponding to the target control strategy.
[0041] In the aforementioned virtual character control method for the game, the attack control area, movement controls, attack direction controls, and attack power display area are integrated into a single interactive control area through a multi-layered distribution within the portrait-oriented game interface. This adapts to the narrow horizontal width of mobile device screens, solving the problems of scattered control controls and difficulty in one-handed coverage in traditional solutions. Players can perform multi-dimensional control without switching control areas, improving the convenience of virtual character control. Simultaneously, by responding to touch operations applied to the interactive control area, the target control strategy for the virtual character is determined. This allows players to trigger one or more operations within the same interactive control area, such as moving the virtual character, adjusting the attack direction, or accumulating attack power, increasing the richness of player touch operations and enhancing the game's strategic depth and enjoyment.
[0042] In addition, the attack power is visualized through the attack power display area, allowing players to perceive changes in attack power in real time and accurately control the rhythm of operation. The operation controls are arranged in layers according to function, with clear logic, which conforms to the operating habits of one-handed thumb and reduces the learning cost for players.
[0043] In some embodiments, such as Figure 4 As shown, step S102 may include steps S401 to S404, and each step is described below.
[0044] Step S401: In response to the press start event of the attack control area, initialize the current attack force and start the timer to obtain the press duration.
[0045] The press start event can refer to the system event triggered the instant the touch point makes contact with the attack control area when the player touches it.
[0046] Specifically, when the player's press operation on the attack control area is detected to begin, the current attack strength is set to an initial value (e.g., 0), and a timer is started to count the duration of the press operation to obtain the press duration.
[0047] Step S402: Update the current attack power frame by frame based on the duration of the press and the charging speed of the virtual character.
[0048] Here, charging speed refers to the rate at which attack power changes per unit of time. In some specific examples, different virtual characters can have different charging speed bonuses. That is, based on the base charging speed, there are different bonus parameters based on the character's attributes and level, resulting in the corresponding charging speed for the virtual character. Specifically, the bonus parameter can be 0.2, 0.3, or other parameters.
[0049] During the continuous pressing operation, the current attack power is calculated and updated in real time, based on the statistical pressing duration and the charging speed of the currently controlled virtual character, using the rendered frame as the unit.
[0050] Step S403: Synchronously output the current attack power to the attack power display area for visual display.
[0051] Specifically, the updated current attack strength for each frame is transmitted in real time to the attack strength display area and displayed as a progress bar, numerical value, special effects, or other visual forms.
[0052] Step S404: In response to the press end event acting on the attack control area, stop the timer and determine the current attack strength data as the target attack strength.
[0053] Specifically, when the user's pressing operation in the attack control area ends, the timer is stopped, the current attack strength is locked, and it is determined as the target attack strength for the final effective attack.
[0054] By displaying the attack power in the attack power display area, players can intuitively grasp the charging level, improve operational accuracy, and reduce misoperations.
[0055] In some embodiments, such as Figure 5As shown, the interactive control area 210 may also include a cancel attack area 510.
[0056] The virtual character control method may also include the following steps: determining whether the release operation position corresponding to the press end event is within the range of the attack cancellation zone; if the release operation position is not within the range of the attack cancellation zone, controlling the virtual character to perform an attack operation with the target attack force; and if the release operation position is within the range of the attack cancellation zone, canceling the attack operation.
[0057] In some embodiments, the virtual character control method may further include the following steps: in response to a press start event in the attack control area, setting the charge intensity change flag to an increasing state, and when the current attack intensity reaches a preset full intensity threshold, switching the charge intensity change flag to a decreasing state.
[0058] The charge-up strength indicator is a system-preset status flag indicating whether the attack strength is increasing or decreasing at the current moment, specifically including increasing and decreasing states. The full strength threshold can be the upper limit or maximum value of the attack strength, a fixed critical value set by the system. The full strength threshold is greater than the initial value of the attack strength. In some specific examples, the full strength threshold may be different for different virtual characters.
[0059] When the player begins pressing the attack control area, the current attack strength is set to an initial value, which is inevitably less than the full strength threshold. Therefore, the attack strength change marker is set to an increasing state; that is, the attack strength increases continuously as the player's touch input duration accumulates. When the current attack strength reaches the full strength threshold, the attack strength change marker is switched to a decreasing state; that is, after this moment, the current attack strength begins to decrease with the accumulation of continuous pressing duration. Updating the current attack strength frame-by-frame based on the pressing duration and the virtual character's corresponding charging speed can include the following steps: updating the current attack strength frame-by-frame based on the pressing duration, the virtual character's corresponding charging speed, and the attack strength change marker.
[0060] The attack power indicator automatically switches between increasing and decreasing states, causing the attack power to automatically drop back after reaching the full power threshold, forming a cyclical change. This eliminates the need for players to repeatedly press the button, making the operation smoother and more natural.
[0061] In some specific examples, in response to a press-to-start event in the attack control area (e.g., a press operation event), the client can execute the following code logic: unit.attack_power = 0 / / Sets the current attack power to the initial power of 0; unit.power_add_sign = 1 / / Save the power increase sign for changes in power level; unit.power_add_speed = (config.base_add_speed configuration table base power speed) * (1 + unit.buff_add_speed_rate virtual character's BUFF power speed bonus) / / Calculate power speed; Game.timer.run_every_frame(function update_fire_power) / / Start the frame update timer on the client.
[0062] Furthermore, the client executes the following logic in the corresponding function update_fire_power(delta_time) for each frame update: / / Update the strength of this attack: unit.attack_power = unit.attack_power + delta_time * Configured time to force ratio config.time_to_power * Controls the unit's force increase rate unit.power_add_speed * Force change flag unit.power_add_sign; / / Output the data to the progress bar length in the force display area on the screen: power_width = unit.attack_power * total length of the progress bar in the force display area, power_bar_total_width.
[0063] if (unit.attack_power >= config.full_power) { unit.power_add_sign = -1 / / If the attack power is greater than or equal to the full power, start reducing the charge: }
[0064] In response to the press-to-end event acting on the attack control area, the following code logic can be executed: / / The client disables the frame update timer and stops updating the force: Game.timer.stop_every_frame(update_fire_power) / / Determine whether the release position of the current release operation is within the circular area of the cancel control zone. If (math.distance(cancel_area.pos - touch_pos) >= cancel_area.radius){ / / If the current touch release position is not within the control cancellation area, then an attack is required. / / The client performs an attack using the power (unit.attacker_power) and direction (unit.attack_angle) saved by the current virtual character: Game.try_unit_fire(unit.attacker_power,unit.attack_direction) }
[0065] In some other examples, in response to a press-to-end event acting on the attack control area, the client can also execute the following code logic: / / The client disables the frame update timer and stops updating the force: Game.timer.stop_every_frame(update_fire_power) / / Determine whether the release position of the current release operation is within the circular area of the cancel control zone: If (math.distance(cancel_area.pos - touch_pos) <= cancel_area.radius){ / / If it's within the cancellation range, then cancel this charged attack: Game.try_unit_cancel_fire(unit); } In some embodiments, the movement control includes a left movement sub-control and a right movement sub-control symmetrically distributed on the left and right sides of the attack control area.
[0066] By symmetrically distributing the left-moving sub-controls and right-moving sub-spaces on the left and right sides of the attack control area, a centralized operation area is formed, which can improve the smoothness of player operation.
[0067] Step S102 may include the following steps: responding to a press start event applied to the left or right moving sub-control and determining the corresponding target movement direction.
[0068] When a player presses the left or right movement sub-control, the system recognizes the position information of the player's touch operation, determines the movement direction corresponding to the pressed movement space, and identifies it as the target movement direction. It's easy to understand that the movement direction corresponding to the left movement sub-control is to the left, and the movement direction corresponding to the right movement sub-control is to the right.
[0069] The virtual character control method may further include the following steps: in response to a press-to-start event, controlling the virtual character to move towards the target movement direction; in response to a press-to-end event, controlling the virtual character to stop moving. In some specific examples, in response to a press-to-start event, controlling the virtual character to move towards the target movement direction according to its corresponding movement speed. Different virtual characters may have different movement speed bonuses; that is, based on the base movement speed, different bonus parameters are applied according to the character's attributes and level to obtain the corresponding movement speed of the virtual character. Specifically, the bonus parameter may be 0.2, 0.3, or other parameters.
[0070] Different virtual characters can have different character bonus parameters.
[0071] In some specific examples, in response to a touch operation applied to a mobile control, the client can execute the following code logic: Local direction = move_obj.direction / / Reads the orientation set in the current control area; unit.move_direction = direction / / Sets the current virtual character's movement direction; if(unit.direction!=direction){ / / If the current character's orientation and the selected orientation are inconsistent, change the character's orientation: unit.direction = direction; Game.update_unit_direction_show(unit) / / Update the character's orientation display; } / / Start the frame update timer on the client: Game.timer.run_every_frame(function update_unit_move) .
[0072] Furthermore, the client executes the following logic in the corresponding function update_unit_move(delta_time) for each frame update: Local cur_pos = unit.pos / / Get the current coordinates; / / Calculate movement speed: Local move_speed = config.base_move_speed configures the base movement speed * (1 + uni.buff_move_speed_add) / / Calculate the new coordinates after movement: Local new_pos = cur_pos + unit.move_direction*move_speed* delta_time; unit.pos = new_pos / / Update character coordinates; Game.update_unit_pos_show(unit) / / Update the display of virtual character coordinates.
[0073] In response to the press-to-end event, the client can execute the following code logic: / / The client disables the frame update timer and stops updating the movement position calculation: Game.timer.stop_every_frame(update_unit_move); / / Stop moving, clear the movement direction: unit.move_direction = null .
[0074] In some embodiments, the attack direction control includes an attack direction increase control and an attack direction decrease control respectively distributed on the top and bottom sides of the interactive control area.
[0075] like Figure 6 As shown, step S102 may include steps S601 to S603.
[0076] Step S601: Respond to the press start event acting on the attack direction increase control or attack direction decrease control, determine the corresponding attack direction change flag, start the timer to obtain the duration of the attack direction press.
[0077] The attack direction change markers include a direction increase marker corresponding to the attack direction increase control and a direction decrease marker corresponding to the attack direction decrease control. In some specific examples, the direction increase marker is used to indicate an increase in the attack angle, such as a clockwise rotation, and the direction decrease marker is used to indicate an increase in the attack angle, such as a counterclockwise rotation.
[0078] Step S602: Determine the attack angle change rate based on the preset base attack angle change rate and the character bonus parameters corresponding to the virtual character.
[0079] Specifically, the character bonus parameter for a virtual character can be 0.2, 0.3, or other parameters. This parameter is used to add a bonus to the preset base attack character change speed, resulting in an attack angle change speed corresponding to the virtual character. Different virtual characters can have different character bonus parameters.
[0080] Step S603: Determine the target attack direction of the virtual character based on the attack angle change speed, the attack direction change marker, and the duration of the attack direction press.
[0081] That is, while the player is continuously pressing the attack direction control, the attack direction of the virtual character is adjusted according to the speed of change of the attack angle corresponding to the virtual character and the attack direction change mark. When the pressing operation of the attack direction control ends, the change of attack direction stops, and the current direction is taken as the target attack direction of the virtual character.
[0082] In some specific examples, the direction increment and decrement markers can be represented by 1 and -1 respectively, the duration of the attack direction press can be statistically analyzed based on the image frames of the game interface, and the change in the virtual character's attack direction can be expressed by the following formula: Attack direction change amount = base attack angle change speed × (1 + character bonus parameters) × attack direction change mark × attack direction press duration.
[0083] In some specific examples, in response to a press-to-start event applied to an attack direction increase control or an attack direction decrease control, the client can execute the following code logic: / / Read attack direction change markers: Increase: 1 / Decrease: -1 unit.attack_direction_add_flag = attack_direction_obj.direction_add_flag / / Calculate the rate of change of the attack angle: unit.attack_direction_add_speed = config.base_attack_direction_add_speed +(1+unit.buff_attack_direction_add_speed_rate) / / Start the frame update timer on the client: Game.timer.run_every_frame(function update_unit_attack_direction) Furthermore, the client executes the following logic in the corresponding function `update_unit_attack_direction(delta_time)` for each frame update: / / Update the attack direction of the virtual character: unit.attack_direction = unit.attack_direction+unit.attack_direction_add_speed*unit.attack_direction_add_flag*delta_time.
[0084] In response to the press-end event of a control that increases or decreases the attack direction, the client can execute the following code logic: / / The client disables the frame update timer to stop updating the attack direction: Game.timer.stop_every_frame(update_unit_attack_direction); unit.attack_direction_add_flag = null; unit.attack_direction_add_speed = null.
[0085] In some embodiments, the touch operation includes at least one of single-point pressing, multi-point pressing, and long-press dragging, and the interactive control area is located in the lower central area of the portrait screen game interface to adapt to the one-handed operation coverage of the terminal device.
[0086] Specifically, the various areas or controls in the interactive control area can be freely combined and matched based on the player's operation. Players can select from three dimensions—attack strength, attack direction, and movement direction—according to the current battlefield environment and their own preferences and habits, and use them quickly and conveniently while enjoying a smooth operating experience.
[0087] It should be understood that, although Figure 4 , Figure 6 The steps in the flowchart are shown sequentially according to the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Figure 4 , Figure 6 Unless otherwise expressly stated herein, the steps illustrated and other steps involved in the embodiments are not subject to strict order restrictions and may be performed in other orders. Furthermore, at least some steps in the foregoing embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0088] In a second aspect, embodiments of this disclosure provide a virtual character control device, such as... Figure 7 As shown, the virtual character control device 700 may include: an interactive control area display module 710 and a target control strategy determination module 720. The interactive control area display module 710 is used to display the interactive control area in a portrait-oriented game interface.
[0089] The target control strategy determination module 720 is used to respond to touch operations applied to the interactive control area and determine the target control strategy corresponding to the virtual character based on the touch operation, so that the virtual character can implement the target control strategy.
[0090] The vertical screen game interface is provided by the terminal device. The interactive control area includes an inner attack control area, a middle layer of movement operation controls and attack direction controls, and an outer layer of attack intensity display area.
[0091] The target control strategy includes the target attack intensity, the target attack direction, and / or the target movement direction. The target attack intensity is visualized in the attack intensity display area.
[0092] In some embodiments, the target control strategy determination module 720 includes an attack zone press response unit, an attack intensity update unit, a visualization display unit, and a target attack intensity determination unit.
[0093] The attack zone press response unit is used to respond to the press start event of the attack control zone, initialize the current attack force, start the timer to count down, and obtain the press duration.
[0094] The attack power update unit is used to update the current attack power frame by frame based on the duration of the press and the charging speed of the virtual character.
[0095] The visualization display unit is used to synchronously output the current attack strength to the attack strength display area for visualization.
[0096] The target attack strength determination unit is used to respond to the press end event acting on the attack control area, stop the timer, and determine the current attack strength data as the target attack strength.
[0097] In some embodiments, the interactive control area further includes an attack cancellation zone, and the virtual character control device 700 may further include an attack cancellation judgment module, an attack cancellation module, and an attack execution module. The attack cancellation judgment module determines whether the release operation position corresponding to the press-to-end event is within the attack cancellation zone. The attack cancellation module cancels the attack operation when the release operation position is within the attack cancellation zone. The attack execution module controls the virtual character to execute an attack operation with the target attack force when the release operation position is not within the attack cancellation zone.
[0098] In some embodiments, the virtual character control device 700 may also include a power-up marker determination module and a power-up marker update module.
[0099] The charge mark determination module is used to set the charge force change mark to an increasing state in response to a press start event in the attack control area.
[0100] The charge-up marker update module is used to switch the charge-up marker to a decreasing state when the current attack power reaches a preset full power threshold.
[0101] The attack power update unit is also used to update the current attack power frame by frame based on the duration of the press, the charging speed of the virtual character, and the charging power change markers.
[0102] In some embodiments, the movement control includes a left movement sub-control and a right movement sub-control symmetrically distributed on the left and right sides of the attack control area. The target control strategy determination module 720 may further include a movement control response unit, which is used to respond to a press start event acting on the left movement sub-control or the right movement sub-control to determine the corresponding target movement direction.
[0103] The virtual character control device may also include a movement control module for controlling the virtual character to move in a target movement direction in response to a press start event, and controlling the virtual character to stop moving in response to a press end event.
[0104] In some embodiments, the attack direction control includes an attack direction increase control and an attack direction decrease control respectively distributed on the top and bottom sides of the interactive control area.
[0105] The target control strategy determination module 720 may also include an attack direction spatial response unit, an attack angle change rate determination unit, and a target attack direction determination unit.
[0106] The attack direction spatial response unit is used to respond to the press start event applied to the attack direction increase control or the attack direction decrease control, determine the corresponding attack direction change flag, and start a timer to obtain the duration of the attack direction press. The attack direction change flag includes a direction increase flag corresponding to the attack direction increase control and a direction decrease flag corresponding to the attack direction decrease control.
[0107] The attack angle change rate determination unit is used to determine the attack angle change rate based on the preset base attack angle change rate and the character bonus parameters corresponding to the virtual character.
[0108] The target attack direction determination unit is used to determine the target attack direction of the virtual character based on the attack angle change speed, the attack direction change marker, and the duration of the attack direction press.
[0109] For further specific limitations regarding the virtual character control device 700, please refer to the limitations of the virtual character control method described above. The virtual character control device 700 can also be used to execute further steps of the virtual character control method in the embodiments of this disclosure, which will not be repeated here. Each module in the virtual character control device 700 can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the electronic device in hardware form, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0110] In a third aspect, embodiments of this disclosure provide an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the virtual character control method provided in any embodiment of the first aspect of this disclosure.
[0111] In some embodiments, the electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the electronic device includes a processor, memory, network interface, and display screen connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the virtual character control method in any embodiment of this document. The display screen of the electronic device can be a liquid crystal display (LCD) or an electronic ink display (EIM), and the input device of the electronic device can be a touch layer covering the display screen.
[0112] Those skilled in the art will understand that Figure 8 The structures shown are merely block diagrams of some structures related to the embodiments of this disclosure and do not constitute a limitation on the electronic devices to which the embodiments of this disclosure are applied. Specific electronic devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.
[0113] In a fourth aspect, embodiments of the present disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the virtual character control method provided in any embodiment of the first aspect of the present disclosure.
[0114] The computer-readable storage medium may be Figure 8 The computer-readable storage medium in the electronic device shown.
[0115] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The aforementioned computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments of this disclosure can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0116] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this disclosure.
[0117] The above embodiments merely illustrate several implementation methods of this disclosure, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of protection of this disclosure. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this disclosure, and these all fall within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the appended claims.
Claims
1. A method for controlling a virtual character in a game, characterized in that, The method includes: An interactive control area is displayed in a portrait-oriented game interface provided by a terminal device. The interactive control area includes an inner attack control area, a middle movement operation control and attack direction control, and an outer attack intensity display area. In response to a touch operation applied to the interactive control area, a target control strategy corresponding to the virtual character is determined based on the touch operation, so that the virtual character can implement the target control strategy; The target control strategy includes target attack intensity, target attack direction and / or target movement direction, and the target attack intensity is visualized by the attack intensity display area.
2. The virtual character control method for a game according to claim 1, characterized in that, The response to a touch operation applied to the interactive control area, and the determination of the target control strategy corresponding to the virtual character based on the touch operation, include: In response to the press start event in the attack control area, the current attack force is initialized, and a timer is started to obtain the press duration; The current attack strength is updated frame by frame based on the duration of the press and the charging speed of the virtual character. The current attack intensity is simultaneously output to the attack intensity display area for visual display; In response to the press-to-end event acting on the attack control area, the timer is stopped, and the current attack strength data is determined as the target attack strength.
3. The virtual character control method for games according to claim 2, characterized in that, The interactive control area also includes a cancel attack zone, and the method further includes: Determine whether the release operation position corresponding to the press end event is within the range of the cancel attack zone; When the release operation position is not within the range of the cancel attack zone, control the virtual character to perform an attack operation with the target attack force; The attack operation is cancelled when the release position is within the cancellation attack zone.
4. The virtual character control method for games according to claim 2, characterized in that, The method further includes: In response to the press start event in the attack control area, the charge force change flag is set to an increased state; When the current attack power reaches a preset full power threshold, the power change flag is switched to a reduced state; The step of updating the current attack strength frame by frame based on the duration of the press and the charging speed corresponding to the virtual character includes: The current attack strength is updated frame by frame based on the duration of the press, the charging speed of the virtual character, and the change in the charging strength.
5. The virtual character control method for a game according to claim 1, characterized in that, The movement control includes a left movement sub-control and a right movement sub-control symmetrically distributed on the left and right sides of the attack control area; The response to a touch operation applied to the interactive control area, and the determination of the target control strategy corresponding to the virtual character based on the touch operation, include: In response to a press start event applied to the left or right moving sub-control, determine the corresponding target movement direction; The method further includes: in response to the press start event, controlling the virtual character to move toward the target movement direction; In response to the press-to-end event, the virtual character is controlled to stop moving.
6. The virtual character control method for a game according to claim 1, characterized in that, The attack direction control includes an attack direction increase control and an attack direction decrease control respectively distributed on the upper and lower sides of the interactive control area; The response to a touch operation applied to the interactive control area, and the determination of the target control strategy corresponding to the virtual character based on the touch operation, include: In response to a press start event applied to the attack direction increase control or the attack direction decrease control, a corresponding attack direction change flag is determined, and a timer is started to obtain the duration of the attack direction press; wherein, the attack direction change flag includes a direction increase flag corresponding to the attack direction increase control and a direction decrease flag corresponding to the attack direction decrease control; The attack angle change rate is determined based on the preset base attack angle change rate and the character bonus parameters corresponding to the virtual character. The target attack direction of the virtual character is determined based on the attack angle change speed, the attack direction change marker, and the duration of the attack direction press.
7. The virtual character control method for a game according to claim 1, characterized in that, The touch operation includes at least one of single-point pressing, multi-point pressing, and long-press dragging. The interactive control area is located in the lower central area of the vertical screen game interface to adapt to the one-handed operation coverage of the terminal device.
8. A virtual character control device, characterized in that, A method for controlling virtual characters in a game as described in any one of claims 1 to 7; The device includes: an interactive control area display module and a target control strategy determination module. The interactive control area display module is used to display the interactive control area in the vertical screen game interface, which is provided by the terminal device. The interactive control area includes an attack control area located in the inner layer, a movement operation control and attack direction control located in the middle layer, and an attack intensity display area located in the outer layer. The target control strategy determination module is used to respond to touch operations applied to the interactive control area, and determine the target control strategy corresponding to the virtual character based on the touch operation, so that the virtual character can implement the target control strategy; The target control strategy includes target attack intensity, target attack direction and / or target movement direction, and the target attack intensity is visualized by the attack intensity display area.
9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the virtual character control method of the game as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the virtual character control method of the game according to any one of claims 1 to 7.