The present disclosure relates to the field of human-computer interaction technologies, and in particular, to a method and device for controlling a game virtual object, an electronic device, and a computer readable storage medium.
In game products of a mobile terminal, for a control interface of a game related to driving tools, a joystick operation mode is generally used in the related art, which is similar to operation of an arcade movable joystick of the last century in which a control is pressed in the center and then pushed to the periphery with a range of 360 degrees, thereby controlling a game character to move in a corresponding direction. The joystick operation has a delicate direction correspondence, which is more suitable for the movement control of a biological game character, but is not suitable for conventional vehicles which have settings of moving forward, moving backward, turning left and turning right. Applying the joystick operation to the steering of the vehicles is prone to confuse a player with the joystick operation experience for the biological game character. For example, for a pull-down operation of the joystick, it corresponds to turning around and going on for the biological game character, and corresponds to reversing for the vehicles, which are of completely different operating experience.
It should be noted that the information disclosed in the Background above is only for enhancing the understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
According to an aspect of the present disclosure, there is provided a method for controlling a virtual object, in which a graphical user interface including a game scenario and at least one virtual object is rendered by performing a game application, the method including:
providing a forward control area and a backward control area on the graphical user interface; controlling the virtual object to move forward when a first preset touch control operation is detected on the forward control area; and controlling the virtual object to move backward when the first preset touch control operation is detected on the backward control area; and
controlling the virtual object to turn left forward when a second preset touch control operation which slides from the forward control area to the left is detected controlling the virtual object to turn right forward when the second preset touch control operation which slides from the forward control area to the right is detected; controlling the virtual object to turn left backward when the second preset touch control operation which slides from the backward control area to the left is detected; and controlling the virtual object to turn right backward when the second preset touch control operation which slides from the backward control area to the right is detected.
An aspect of the present disclosure also provides a device for controlling a virtual object, in which a graphical user interface including a game scenario and at least one virtual object is rendered by performing a game application, the device including:
a longitudinal movement control module, configured to provide a forward control area and a backward control area on the graphical user interface; control the virtual object to move forward when a first preset touch control operation is detected on the forward control area; and control the virtual object to move backward when the first preset touch control operation is detected on the backward control area; and
a turning control module, configured to control the virtual object to turn left forward when a second preset touch control operation which slides from the forward control area to the left is detected; control the virtual object to turn right forward when the second preset touch control operation which slides from the forward control area to the right is detected; control the virtual object to turn left backward when the second preset touch control operation which slides from the backward control area to the left is detected; and control the virtual object to turn right backward when the second preset touch control operation which slides from the backward control area to the right is detected.
An aspect of the present disclosure also provides a mobile terminal, including: a processor; and a memory for storing instructions executable by the processor, wherein the processor is configured to perform the method described above by executing the executable instructions.
An aspect of the present disclosure also provides a computer readable storage medium having stored thereon a computer program which, when being executed by a processor, performs the method described above.
It should be noted that the above general description and the following detailed description are merely exemplary and explanatory and should not be construed as limiting of the disclosure.
The accompanying drawings, which are incorporated in the specification and constitute a part of the specification, illustrates embodiments in consistent with the present disclosure. The drawings along with the specification explain the principles of the present disclosure. It is apparent that the drawings in the following description show only some of the embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art based on the drawings without any creative work.
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the embodiments can be implemented in a variety of modes and should not be construed as being limited to the examples set forth herein. Rather, these embodiments are provided so that this disclosure will be more complete and the idea of the exemplary embodiments will be conveyed to those skilled in this art. The described features, structures, or characteristics can be combined in one or more embodiments in any suitable manner.
In view of the above problems, an embodiment of the present application provides a method for controlling a virtual object. In this embodiment, the method for controlling the virtual object is illustrated by way of different examples. The method for controlling the virtual object provided in this embodiment is performed on a mobile terminal device including a touch display screen, and the mobile terminal device can be an electronic terminal device such as a computer, a tablet computer, a mobile phone, or the like. A graphical user interface is rendered by performing a game application, and content displayed by the graphical user interface includes, at least in part, a partial or full game scenario, and the game scenario includes at least one virtual object. As shown in
The game scenario can include virtual resources with relatively fixed locations, such as the ground, mountains, rocks, flowers, grass, trees, buildings, and the like. The virtual object can be either a virtual object of an enemy camp, or a virtual object of the own camp. The virtual object can perform corresponding actions in the game scenario in response to the user's operation. For example, the user may control the virtual object to perform various actions in the game scenario such as moving, advancing, retreating, turning, attacking, shooting, etc., which is not limited herein.
Various steps in the method for controlling the virtual object provided in this embodiment can be performed step by step according to the received touch control operation, or subsequent steps can be automatically performed after the method provided by the embodiment is triggered. The various steps can be performed in sequence, or part or all of the steps can be performed simultaneously. The specific order of the steps is not specifically limited, and adaptive adjustment and setting can be made according to actual conditions. As shown in
In step S101, a forward control area and a backward control area are provided on the graphical user interface, the virtual object is controlled to move forward when a first preset touch control operation is detected on the forward control area, and the virtual object is controlled to move backward when the first preset touch control operation is detected on the backward control area.
In step S102, the virtual object is controlled to turn left forward when a second preset touch control operation which slides from the forward control area to the left is detected; the virtual object is controlled to turn right forward when the second preset touch control operation which slides from the forward control area to the right is detected; the virtual object is controlled to turn left backward when the second preset touch control operation which slides from the backward control area to the left is detected; and the virtual object is controlled to turn right backward when the second preset touch control operation which slides from the backward control area to the right is detected.
The first preset touch control operation performed on the forward control area and the backward control area can be long pressing, clicking, sliding, or the like. However, in order to be distinguished from the second preset touch control operation for controlling the turning of the virtual object, the first preset operation cannot be a lateral sliding touch control operation. The second preset touch control operation is the lateral sliding touch control operation, and the lateral direction is not limited to the direction parallel to a horizontal axis of the screen, as long as the direction of the sliding touch control operation includes a lateral component. The second preset touch control operation can be a simple lateral sliding touch control operation, or a sliding touch control operation in which a displacement in the lateral direction exceeds a preset length, or can be a sliding touch control operation moving out of the forward control area or the backward control area. It should be noted that the first preset touch control operation and the second preset touch control operation can be two separate touch control operations, or can be one consecutive touch control operation. For example, a long press operation is performed on the forward control area first to control the virtual object to move forward, and then the operation slides out of the forward control area from left so as to control the virtual object to turn left forward.
As shown in
In a specific embodiment, when a sliding touch control operation of which a touch start point is located in the forward control area 3 and which moves out of the forward control area 3 to the left is detected, the virtual object 2 is controlled to turn left forward; and when the sliding touch control operation of which the touch start point is located in the forward control area 3 and which moves out of the forward control area 3 to the right is detected, as shown in
The shape of the forward control area 3 and the backward control area 4 is not limited to the square shown in
The forward control area 3 and the backward control area 4 can be set to be visible or invisible. Displaying each of the control areas by the contour lines shown in
According to the above embodiments, the forward control area and the backward control area are provided on the graphical user interface. According to the detected different touch control operations performed on the above two control areas, the virtual object is controlled to move forward, move backward, turn left forward, turn right forward, turn left backward and turn right backward, thereby providing the game user with control experience which is closer to that of steering a real vehicle in the game scenario, not confusing the game user with the common movement control operations of the biological virtual objects, and making it easier for new users to start playing.
In another embodiment, the forward control area is positioned above the backward control area on the graphical user interface, which indicates that the forward control area is in front of the backward control area on the graphical user interface from the perspective of the user. As shown in
In another embodiment, a distance between the forward control area and the backward control area is within a preset distance range, and the preset distance range is configured to ensure that a user can touch and control with one hand.
As shown in
In another embodiment, a visual prompt control is provided on at least one of the forward control area, the backward control area, a left side of the forward control area, a right side of the forward control area, a left side of the backward control area, and a right side of the backward control area.
As shown in
As shown in
In addition to the specific situations shown in
In another embodiment, the method further includes: providing a forward visual prompt control in the forward control area and displaying a turning visual prompt control on the left and right sides of the forward control area, respectively, when a touch control operation in which at least part of touch points are located in the forward control area is detected. As shown in
Further, the method further includes: stopping the displaying of the turning visual prompt controls when it is detected that the touch control operation in which at least part of the touch points are located in the forward control area ends. When it is detected that the touch control operation in which at least part of the touch points are located in the forward control area 3 ends (for example, the finger 5 long-pressing the forward control area 3 lifts up), the turning prompt controls are no longer displayed, as shown in
In another embodiment, the method further includes: providing a backward visual prompt control in the backward control area; and displaying a turning visual prompt control on the left and right sides of the backward control area, respectively, when a touch control operation in which at least part of touch points are located in the backward control area is detected. As shown in
Further, the method further includes: stopping the displaying of the turning visual prompt control when it is detected that the touch control operation in which at least part of touch points are located in the backward control area ends. When it is detected that the touch control operation in which at least part of the touch points are located in the backward control area 4 ends (for example, the finger 5 long-pressing the backward control area 4 lifts up), the turning prompt controls are no longer displayed, as shown in
In another embodiment, the method further includes at least one of the following:
adjusting a forward turning angle of the virtual object according to a first lateral distance between a real-time position of a touch point and the forward control area when the second preset touch control operation which slides from the forward control area to the left or to the right is detected; and adjusting a backward turning angle of the virtual object according to a second lateral distance between the real-time position of the touch point and the backward control area when the second preset touch control operation which slides from the backward control area to the left is detected or to the right.
In this embodiment, when the virtual object is controlled to turn left forward or turn right forward by the user, the first lateral distance between the touch point and the forward control area is detected. The larger the first lateral distance is, the larger the turning angle of the virtual object is (the farther the touch point goes to the left, the greater the angle at which the virtual object turns left forward is: the farther the touch point goes to the right, the greater the angle at which the virtual object turns right forward is). Similarly, when the virtual object is controlled to turn left backward or to turn right backward by the user, the second lateral distance between the touch point and the backward control area is detected. The larger the second lateral distance is, the larger the turning angle of the virtual object is (the farther the touch point goes to the left, the greater the angle at which the virtual object turns left backward is; the farther the touch point goes to the right, the greater the angle at which the virtual object turns right backward is).
The relationship between the turning angle and the first lateral distance and the relationship between the turning angle and the second lateral distance can be a linear proportional relationship, a nonlinear positive correlation relationship, or a relationship similar to energy level transition (for example, when the lateral sliding distance is greater than 0 and less than 5 mm, the turning angle is 5 degrees; when the lateral sliding distance is greater than or equal to 5 mm and less than 10 mm, the turning angle is 10 degrees; when the sliding distance is greater than or equal to 10 mm and less than 15 mm, the turning angle is 15 degrees; and so on). Obviously, there is a limit on the turning angle. When the turning angle reaches the limit, even if the sliding distance (i.e., the first lateral distance and the second lateral distance) continues to increase, the turning angle does not increase any more.
The first lateral distance between the real-time position of the touch point and the forward control area can be a distance from the real-time position of the touch point to the center of the forward control area, or a distance from the real-time position of the touch point to the left or right side of the forward control area. Similarly, the second lateral distance between the real-time position of the touch point and the backward control area can be a distance from the real-time position of the touch point to the center of the backward control area, or a distance from the real-time position of the touch point to the left or right side of the backward control area.
In this embodiment, the user can control the turning angle of the virtual object by controlling the lateral distance of the touch point from the forward control area or from the backward control area during the process of controlling the turning of the virtual object, thereby enriching the control modes while improving the immersion feeling of the game for the user.
As shown in
a longitudinal movement control module 901, configured to provide a forward control area and a backward control area on the graphical user interface; control the virtual object to move forward when a first preset touch control operation is detected on the forward control area; and control the virtual object to move backward when the first preset touch control operation is detected on the backward control area; and
a turning control module 902, configured to control the virtual object to turn left forward when a second preset touch control operation which slides from the forward control area to the left is detected; control the virtual object to turn right forward when the second preset touch control operation which slides from the forward control area to the right is detected; control the virtual object to turn left backward when the second preset touch control operation which slides from the backward control area to the left is detected; and control the virtual object to turn right backward and right when the second preset touch control operation which slides from the backward control area to the right is detected.
The specific details of each module unit in the foregoing embodiment have been described in the corresponding method for controlling the virtual object. In addition, it can be understood that the device for controlling the virtual object further includes other unit modules corresponding to the information processing method, and therefore will not be described herein.
It should be noted that although several modules or units of devices for performing actions are described above, such division of modules or units is not mandatory. In fact, features and functions of two or more of the modules or units described above may be embodied in one module or unit in accordance with the embodiments of the present disclosure. Alternatively, the features and functions of one module or unit described above may be further divided into multiple modules or units.
The processor is configured to perform the following steps by executing executable instructions:
rendering a graphical user interface by performing a game application, wherein the graphical user interface includes a game scenario and at least one virtual object;
providing a forward control area and a backward control area on the graphical user interface; controlling the virtual object to move forward when a first preset touch control operation is detected on the forward control area; and controlling the virtual object to move backward when the first preset touch control operation is detected on the backward control area; and
controlling the virtual object to turn left forward when a second preset touch control operation which slides from the forward control area to the left is detected; controlling the virtual object to turn right forward when the second preset touch control operation which slides from the forward control area to the right is detected; controlling the virtual object to turn left backward when the second preset touch control operation which slides from the backward control area to the left is detected; and controlling the virtual object to turn right backward when the second preset touch control operation which slides from the backward control area to the right is detected.
Optionally, a position of the forward control area on the graphical user interface is higher than that of the backward control area.
Optionally, a distance between the forward control area and the backward control area is within a preset distance range, and the preset distance range is configured to ensure that a user can touch and control with one hand.
Optionally, the processor is further configured to:
provide a visual prompt control on at least one of the forward control area, the backward control area, a left side of the forward control area, a right side of the forward control area, a left side of the backward control area, and a right side of the backward control area.
Optionally, the processor is further configured to:
provide a forward visual prompt control in the forward control area; and
display a turning visual prompt control on left and right sides of the forward control area, respectively, when a touch control operation in which at least part of touch points are located in the forward control area is detected.
Optionally, the processor is further configured to:
stop the displaying of the turning visual prompt controls when detecting that the touch control operation in which at least part of touch points are located in the forward control area ends.
Optionally, the processor is further configured to:
provide a backward visual prompt control in the backward control area and
display a turning visual prompt control on left and right sides of the backward control area, respectively, when a touch control operation in which at least part of touch points are located in the backward control area is detected.
Optionally, the processor is further configured to:
stop the displaying of the turning visual prompt control when it is detected that the touch control operation in which at least part of touch points are located in the backward control area ends.
Optionally, the processor is further configured to perform at least one of the following:
adjusting a forward turning angle of the virtual object according to a first lateral distance between a real-time position of a touch point and the forward control area when the second preset touch control operation which slides from the forward control area to the left or the right is detected; and
adjusting a backward turning angle of the virtual object according to a second lateral distance between the real-time position of the touch point and the backward control area when the second preset touch control operation which slides from the backward control area to the left is detected or the right.
According to the mobile terminal provided by the present application, the forward control area and the backward control area are provided on the graphical user interface. According to the detected different touch control operations performed on the above two control areas, the virtual object is controlled to move forward, move backward, turn left forward, turn right forward, turn left backward, and turn right backward, thereby providing the game user with control experience which is closer to that of steering a real vehicle in the game scenario, not confusing the game user with the common movement control operations of the biological virtual objects, and making it easier for new users to start playing.
In an alternative embodiment, the mobile terminal can further include one or more processors, and memory resources represented by the memory for storing instructions executable by the processing components, such as an application. The application stored in the memory can include one or more modules each corresponding to a set of instructions. Additionally, the processing components are configured to execute instructions to perform the method for controlling the virtual object described above.
The mobile terminal can further include: a power component, configured to perform power management for the mobile terminal; a wired or wireless network interface, configured to connect the mobile terminal to the network; and an input/output (I/O) interface. The mobile terminal can operate based on an operating system stored in the memory, such as Android, iOS, Windows, Mac OS X, Unix, Linux, FreeBSD or the like.
rendering a graphical user interface by performing a game application, wherein the graphical user interface includes a game scenario and at least one virtual object;
providing a forward control area and a backward control area on the graphical user interface; controlling the virtual object to move forward when a first preset touch control operation is detected on the forward control area; and controlling the virtual object to move backward when the first preset touch control operation is detected on the backward control area and
controlling the virtual object to turn left forward when a second preset touch control operation which slides from the forward control area to the left is detected; controlling the virtual object to turn right forward when the second preset touch control operation which slides from the forward control area to the right is detected; controlling the virtual object to turn left backward when the second preset touch control operation which slides from the backward control area to the left is detected; and controlling the virtual object to turn right backward when the second preset touch control operation which slides from the backward control area to the right is detected.
Optionally, a position of the forward control area on the graphical user interface is higher than that of the backward control area.
Optionally, a distance between the forward control area and the backward control area is within a preset distance range, and the preset distance range is configured to ensure that a user can touch and control with one hand.
Optionally, when the computer program is executed by a processor, the following step is implemented:
providing a visual prompt control on at least one of the forward control area, the backward control area, a left side of the forward control area, a right side of the forward control area, a left side of the backward control area, and a right side of the backward control area.
Optionally, when the computer program is executed by a processor, the following steps are implemented:
providing a forward visual prompt control in the forward control area; and
displaying a turning visual prompt control on the left and right sides of the forward control area, respectively, when a touch control operation in which at least part of touch points are located in the forward control area is detected.
Optionally, when the computer program is executed by a processor, the following step is implemented:
stopping the displaying of the turning visual prompt control when it is detected that the touch control operation in which at least part of the touch points are located in the forward control area ends.
Optionally, when the computer program is executed by a processor, the following steps are implemented:
providing a backward visual prompt control in the backward control area; and
displaying a turning visual prompt control on the left and right sides of the backward control area, respectively, when detecting a touch control operation in which at least part of the touch points are located in the backward control area.
Optionally, when the computer program is executed by a processor, the following step is implemented:
stopping the displaying of the turning visual prompt control when it is detected that the touch control operation in which at least part of the touch points are located in the backward control area ends.
Optionally, when the computer program is executed by a processor, at least one of the following steps is performed:
adjusting a forward turning angle of the virtual object according to a first lateral distance between a real-time position of the touch point and the forward control area when the second preset touch control operation which slides from the forward control area to the left or the right is detected; and
adjusting a backward turning angle of the virtual object according to a second lateral distance between the real-time position of the touch point and the backward control area when the second preset touch control operation which slides from the backward control area to the left is detected or the right.
According to the computer storage medium provided by the present application, the forward control area and the backward control area are provided on the graphical user interface. According to the detected different touch control operations performed on the above two control areas, the virtual object is controlled to move forward, move backward, turn left forward, turn right forward, turn left backward, and turn right backward, thereby providing the game user with control experience which is closer to that of steering a real vehicle in the game scenario, not confusing the game user with the common movement control operations of the biological virtual objects, and making it easier for new users to start playing.
The program codes embodied in a computer readable storage medium can be transmitted with any suitable media, including but not limited to wireless, wired, optical cable, radio frequency, etc., or any suitable combination of the foregoing.
Through the description of the above embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented in software or in a combination of software with necessary hardware. Therefore, the technical solutions according to embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes pieces of instructions to cause a computing device (which may be a personal computer, a server, a mobile terminal, a network device, or the like) to perform the methods in accordance with the embodiments of the present disclosure.
Other embodiments of the present disclosure will be apparent to those skilled in the art after considering the specification and practicing the disclosure disclosed herein. The present application is intended to cover any variation, use, or adaptation of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are considered to be only illustrative, and the real scope and spirit of the present disclosure are defined by the claims.
It is to be understood that the present disclosure is not limited to the precise structures that have been described above and illustrated in the drawings, and can be modified and changed in various ways without departing from the scope thereof. The scope of the disclosure is to be limited only by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
201810652486.5 | Jun 2018 | CN | national |
The present application is the 371 application of PCT Application No. PCT/CN2018/112734, filed on Oct. 30, 2018, which is based on and claims priority to Chinese Patent Application No. 201810652486.5, filed on Jun. 22, 2018, the entire contents of both of which are incorporated herein by reference.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2018/112734 | 10/30/2018 | WO | 00 |