A method of controlling a game character and an electronic device

CN116966580BActive Publication Date: 2026-10-13HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210432830.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2026-10-13
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

然而,由于体感游戏的紧张刺激和强沉浸感导致用户的注意力更多放在对游戏角色的操控上,即使游戏界面中有小窗显示用户的大体位置,但往往不能被用户及时感知,仍然难以避免用户游戏过程中的磕碰发生

Benefits of technology

[0061]第五方面及第五方面中任意一种实现方式所对应的技术效果,可参见上述各方面及各方面中任意一种实现方式所对应的技术效果,此处不再赘述。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116966580B_ABST
    Figure CN116966580B_ABST
Patent Text Reader

Abstract

The application provides a method for controlling a game character and an electronic device. In a scenario where the game character is about to switch to an initial race track, if a distance between a current position of a user and an initial position of the user in a horizontal direction is greater than a preset threshold, in a case where the current position of the user is located on a left side of the initial position of the user, the game character is switched to a left side area of the initial race track, and in a case where the current position of the user is located on a right side of the initial position of the user, the game character is switched to a right side area of the initial race track. If the distance between the current position of the user and the initial position of the user in the horizontal direction is less than or equal to the preset threshold, the game character is switched to a middle position of the initial race track in the horizontal direction. The scheme can avoid safety problems such as bumping as much as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal games, and more particularly to a method for controlling game characters and an electronic device. Background Technology

[0002] In motion-sensing games and augmented reality (AR) / virtual reality (VR) games, users are placed in virtual environments, gaining an immersive gaming experience. However, because users are immersed in the exciting game visuals or the realistic virtual world, they may lack timely attention to their surroundings, potentially leading to personal safety accidents such as collisions and injuries.

[0003] Some solutions use a camera to capture the user's location and then display it in a small window within the game interface. By observing this window, the user can roughly determine their location and gain a general understanding of their activity range and safety. However, the intense excitement and immersive nature of motion-sensing games cause users to focus more on controlling their character. Even with a small window displaying the user's approximate location, it's often not immediately apparent, making it difficult to prevent bumps and collisions during gameplay. Furthermore, the small window display disrupts the consistency of the visual style, creating a sense of visual fragmentation. In full-frame motion-sensing games and AR / VR games, it can even cause occlusion and interference, negatively impacting the overall motion-sensing gaming experience.

[0004] Therefore, our need is to enable users to pay attention to their environment in real time and make appropriate adjustments during the game without disrupting the user's gaming experience, so as to avoid personal safety incidents such as collisions with the surrounding environment. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a method and electronic device for controlling game characters. The technical solution provided by this application can reduce the occurrence of personal safety incidents such as bumps and collisions during motion-sensing games and AR / VR games, thus protecting the user's personal safety to a certain extent.

[0006] Firstly, a method for controlling a game character is provided, comprising: determining whether the user's corresponding game character will switch to the initial track; if the game character will switch to the initial track, obtaining a first distance, the first distance being the horizontal distance between the user's current position and the user's initial position; when the user is at the initial position, the game character is located at the middle position of the initial track in the horizontal direction; if the first distance is greater than a preset threshold, if the user's current position is to the left of the initial position, switching the game character to a first area, and if the user's current position is to the right of the initial position, switching the game character to a second area, wherein both the first area and the second area are located within the initial track, the first area is located to the left of the initial track, and the second area is located to the right of the initial track; if the first distance is less than or equal to the preset threshold, switching the game character to the middle position of the initial track in the horizontal direction.

[0007] For example, the first region and the second region have no overlap.

[0008] For example, the preset threshold can be determined based on empirical values.

[0009] For example, the preset threshold is less than the judgment threshold, which is the threshold used to determine whether to switch the game character from the current track to an adjacent track. For example, the judgment threshold is T, and the preset threshold is less than T, such as 0.2T.

[0010] Based on this solution, the user's position and movement distance are cleverly integrated into the game screen. Visual feedback guides the user to adjust their position, thus mitigating safety issues such as collisions caused by cumulative deviation. Furthermore, this solution does not alter the game mechanics or disrupt the visuals, thus preserving the user's gaming experience.

[0011] In some possible implementations, when the number of game tracks is odd, the initial track is the middle track in the game; when the number of game tracks is even, the initial track is one of the two middle tracks in the game.

[0012] In some possible implementations, when the first distance is greater than a preset threshold, the method may further include: setting the first track as an unavailable track and generating a second track, wherein if the user's current position is to the left of the initial position, the first track is the leftmost track in the current game track, and the second track is the right adjacent track of the rightmost track in the current game track; if the user's current position is to the right of the initial position, the first track is the rightmost track in the current game track, and the second track is the left adjacent track of the leftmost track in the current game track.

[0013] For example, the first track can be made unusable by setting obstacles on it.

[0014] Based on this solution, by combining the user's current location, the game automatically provides feedback based on the game mechanics. Without changing the game mechanics or disrupting the consistency of the game experience, it can further guide the user to move closer to the initial position during the game, thereby avoiding dangerous situations such as bumps and collisions caused by cumulative deviation.

[0015] In some possible implementations, the game track is set to have uneven edges, which is used to create a swaying effect for the game character when it is in the first or second area.

[0016] Based on this scheme, when the user's position exceeds a certain distance from the initial position, the game character can be displayed at the edge of the track (i.e., the first or second zone), creating a swaying effect. When the user's position is within a certain distance of the initial position, the game character can be displayed in the middle of the initial track. In this case, the game character is displayed normally without swaying, allowing the user to know that they are near the initial position. This automatic adjustment of the game screen display guides the user back to the initial position, thus mitigating safety issues such as collisions caused by cumulative deviation. Furthermore, this scheme does not require altering the game mechanics or disrupting the game visuals, thus not affecting the user's gaming experience.

[0017] In some possible implementations, the first area and / or the second area are equipped with a first facility for slowing down the game character.

[0018] For example, the first facility could be a roadblock or a speed bump.

[0019] Based on this solution, when the user's position exceeds a certain distance from the initial position, the game character can be displayed at the edge of the track, thus causing a deceleration effect. When the user's position is within a certain distance of the initial position, the game character can be displayed in the middle of the initial track. In this case, the game character is displayed normally without any deceleration effect, allowing the user to know that they are near the initial position. This automatic adjustment of the game screen display guides the user back to the initial position, thereby avoiding safety issues such as collisions caused by cumulative deviation to a certain extent. Furthermore, this solution does not require changing the game mechanics, nor does it disrupt the game visuals or affect the user's gaming experience.

[0020] In some possible implementations, the initial location is within a safe zone, which is determined based on the user's environment.

[0021] Based on this solution, users can avoid standing in positions prone to collisions from the outset, thereby reducing the risk of collisions caused by deviations in the user's initial position.

[0022] In some possible implementations, the initial position is located within a safe zone, which is a safe area set with the center of the electronic device's display screen as the center, or the safe zone is a safe area set with the initial position as the center.

[0023] Secondly, a method for controlling a game character is provided, comprising: switching the game character to the initial track when the user's corresponding game character is about to switch to the initial track; obtaining a first distance, the first distance being the horizontal distance between the user's current position and the user's initial position, wherein when the user is at the initial position, the game character is at the middle position of the initial track in the horizontal direction; if the first distance is greater than a preset threshold, setting the first track as an unavailable track and generating a second track; and if the first distance is less than or equal to the preset threshold, switching the game character to the initial track, wherein if the user's current position is to the left of the initial position, the first track is the leftmost track in the current game track, and the second track is the right adjacent track of the rightmost track in the current game track; if the user's current position is to the right of the initial position, the first track is the rightmost track in the current game track, and the second track is the left adjacent track of the leftmost track in the current game track.

[0024] For example, the preset threshold can be determined based on empirical values.

[0025] For example, the preset threshold is less than the judgment threshold, which is the threshold used to determine whether to switch the game character from the current track to an adjacent track. For example, the judgment threshold is T, and the preset threshold is less than T, such as 0.2T.

[0026] Based on this solution, by combining the user's current position, the game automatically provides feedback based on the game mechanics. Without changing the game mechanics or disrupting the consistency of the game experience, it can guide the user to continuously move closer to the initial position during the game, thereby avoiding dangerous situations such as collisions caused by cumulative deviation.

[0027] In some possible implementations, the first track can be made unavailable by setting obstacles on it.

[0028] In some possible implementations, the initial location is within a safe zone, which is determined based on the user's environment.

[0029] Based on this solution, users can avoid standing in positions prone to collisions from the outset, thereby reducing the risk of collisions caused by deviations in the user's initial position.

[0030] In some possible implementations, the initial position is located within a safe zone, which is a safe area set with the center of the electronic device's display screen as the center, or the safe zone is a safe area set with the initial position as the center.

[0031] Thirdly, a method for controlling a game character is provided, comprising: when the user's game character is about to switch to the initial track, obtaining a first distance, the first distance being the horizontal distance between the user's current position and the user's initial position; when the user is at the initial position, the game character is located in the middle of the initial track in the horizontal direction; if the first distance is greater than a first preset threshold, if the user's current position is to the left of the initial position, switching the game character to a first area; if the user's current position is to the right of the initial position, switching the game character to a second area; if the first distance is less than or equal to the first preset threshold, switching the game character to the middle of the initial track in the horizontal direction. The positions are defined as follows: the first area and the second area are both located within the initial track, the first area is located to the left of the initial track, and the second area is located to the right of the initial track; and, if the first distance is greater than the second preset threshold, the first track is set as an unavailable track, and a second track is generated, wherein if the user's current position is to the left of the initial position, the first track is the leftmost track in the current game track, and the second track is the right adjacent track of the rightmost track in the current game track; if the user's current position is to the right of the initial position, the first track is the rightmost track in the current game track, and the second track is the left adjacent track of the leftmost track in the current game track, wherein the second preset threshold is greater than the first preset threshold.

[0032] For example, the first region and the second region have no overlap.

[0033] For example, the first preset threshold and / or the second preset threshold can be determined based on empirical values.

[0034] For example, both the first preset threshold and the second preset threshold are less than the judgment threshold, which is the threshold used to determine whether to switch the game character from the current track to an adjacent track. For example, the judgment threshold is T, and both the first preset threshold and the second preset threshold are less than T, such as the first preset threshold being 0.2T and the second preset threshold being 0.4T.

[0035] Based on this solution, the user's position and movement distance are cleverly integrated into the game screen. The game's visual feedback guides the user to adjust their position. Furthermore, by combining the user's current position with the game's mechanics, the game automatically provides feedback to guide the user to continuously move closer to their initial position, thereby avoiding dangerous situations such as collisions caused by cumulative deviation.

[0036] In some possible implementations, the game track is set to have uneven edges, which is used to create a swaying effect for the game character when it is in the first or second area.

[0037] Based on this scheme, when the user's position exceeds a certain distance from the initial position, the game character can be displayed at the edge of the track (i.e., the first or second zone), creating a swaying effect. When the user's position is within a certain distance of the initial position, the game character can be displayed in the middle of the initial track. In this case, the game character is displayed normally without swaying, allowing the user to know that they are near the initial position. This automatic adjustment of the game screen display guides the user back to the initial position, thus mitigating safety issues such as collisions caused by cumulative deviation. Furthermore, this scheme does not require altering the game mechanics or disrupting the game visuals, thus not affecting the user's gaming experience.

[0038] In some possible implementations, the first area and / or the second area are equipped with a first facility for slowing down the game character.

[0039] For example, the first facility could be a roadblock or a speed bump.

[0040] Based on this solution, when the user's position exceeds a certain distance from the initial position, the game character can be displayed at the edge of the track, thus causing a deceleration effect. When the user's position is within a certain distance of the initial position, the game character can be displayed in the middle of the initial track. In this case, the game character is displayed normally without any deceleration effect, allowing the user to know that they are near the initial position. This automatic adjustment of the game screen display guides the user back to the initial position, thereby avoiding safety issues such as collisions caused by cumulative deviation to a certain extent. Furthermore, this solution does not require changing the game mechanics, nor does it disrupt the game visuals or affect the user's gaming experience.

[0041] In some possible implementations, the initial location is within a safe zone, which is determined based on the user's environment.

[0042] Based on this solution, users can avoid standing in positions prone to collisions from the outset, thereby reducing the risk of collisions caused by deviations in the user's initial position.

[0043] In some possible implementations, the initial position is located within a safe zone, which is a safe area set with the center of the electronic device's display screen as the center, or the safe zone is a safe area set with the initial position as the center.

[0044] Fourthly, a method for controlling a game character is provided, comprising: determining whether the user's corresponding game character will switch game tracks; if the game character will switch game tracks, obtaining a first distance, the first distance being the horizontal distance between the user's current position and the user's initial position, wherein when the user is at the initial position, the game character is at the middle position of the initial track in the horizontal direction; if the first distance is greater than a preset threshold corresponding to the target track, if the user's current position is to the left of the initial position, switching the game character to a first area, and if the user's current position is to the right of the initial position, switching the game character to a second area; if the first distance is less than or equal to the preset threshold, and the target track is not the initial track, if the user's current position is to the left of the initial position, switching the game character to the second area or the middle position of the target track in the horizontal direction, and if the user's current position is to the right of the initial position, switching the game character to the first area or the middle position of the target track in the horizontal direction; and if the first distance is less than or equal to the preset threshold, and the target track is the initial track, switching the game character to the middle position of the target track in the horizontal direction. The first and second zones are both located within the target track, with the first zone on the left side of the target track and the second zone on the right side.

[0045] It should be understood that the target track is the track the game character will switch to. Additionally, different tracks have different preset thresholds.

[0046] For example, the first region and the second region have no overlap.

[0047] In one example, the preset threshold corresponding to the initial track is less than the judgment threshold, which is the threshold used to determine whether to switch the game character from the current track to an adjacent track. For example, the judgment threshold is T, and the preset threshold is less than T, such as 0.2T. The preset threshold corresponding to the Rth track to the left or right of the initial track is greater than R*T and less than (R+1)*T. For example, the preset threshold corresponding to the Rth track to the left or right of the initial track is R*T+αT, where αT is the preset threshold corresponding to the initial track, 0 < α < 1.

[0048] In one example, the preset thresholds for each track (game track) can be determined based on empirical values.

[0049] Based on this solution, the user's position and movement distance are cleverly integrated into the game screen. Visual feedback guides the user to adjust their position, thus mitigating safety issues such as collisions caused by cumulative deviation. Furthermore, this solution does not alter the game mechanics or disrupt the visuals, thus preserving the user's gaming experience.

[0050] In some possible implementations, when the number of game tracks is odd, the initial track is the middle track in the game; when the number of game tracks is even, the initial track is one of the two middle tracks in the game.

[0051] In some possible implementations, the game track is set to have uneven edges, which is used to create a swaying effect for the game character when it is in the first or second area.

[0052] Based on this solution, when a game character is switched to the edge of the corresponding track, a swaying effect can be made to indicate the approximate distance between the character's current position and the initial position, thus guiding the user to move back to the initial position. This can, to some extent, prevent safety issues such as collisions caused by accumulated deviation. Furthermore, this solution does not require changing the game mechanics, nor does it disrupt the game visuals or affect the user's gaming experience.

[0053] In some possible implementations, the first area and / or the second area are equipped with a first facility for slowing down the game character.

[0054] For example, the first facility could be a roadblock or a speed bump.

[0055] Based on this scheme,

[0056] When a game character is switched to the edge of the track, a deceleration effect is applied to indicate the approximate distance from the initial position to the user, guiding them back towards the starting point. This helps to mitigate safety issues such as collisions caused by accumulated deviation. Furthermore, this solution does not alter the game mechanics or disrupt the visuals, thus not affecting the user's gaming experience.

[0057] In some possible implementations, the initial location is within a safe zone, which is determined based on the user's environment.

[0058] Based on this solution, users can avoid standing in positions prone to collisions from the outset, thereby reducing the risk of collisions caused by deviations in the user's initial position.

[0059] In some possible implementations, the initial position is located within a safe zone, which is a safe area set with the center of the electronic device's display screen as the center, or the safe zone is a safe area set with the initial position as the center.

[0060] Fifthly, an electronic device is provided, the electronic device including a processor, a memory and a computer program, wherein the computer program is stored in the memory, and when the computer program is executed by the processor, causes the electronic device to perform the method of any of the above aspects and any embodiment of the above aspects.

[0061] For the technical effects of the fifth aspect and any of its implementation methods, please refer to the above aspects and any of its implementation methods; they will not be repeated here.

[0062] Sixthly, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as instructions or code) that, when executed by a computer, causes the computer to perform the method of any of the above aspects and any embodiment thereof.

[0063] For the technical effects of the sixth aspect and any of its implementation methods, please refer to the above aspects and any of their implementation methods; they will not be repeated here.

[0064] A seventh aspect provides a chip. The chip includes a processor and a memory, the processor being configured to read and execute a computer program stored in the memory to perform the method of any of the preceding aspects and any embodiment thereof.

[0065] For the technical effects of the seventh aspect and any of its implementation methods, please refer to the above aspects and any of its implementation methods; they will not be repeated here.

[0066] Eighthly, a computer program product is provided. The computer program product includes a computer program (also referred to as instructions or code), which, when executed by a computer, causes the computer to perform the method of any of the above aspects and any implementation thereof.

[0067] For the technical effects corresponding to the eighth aspect and any of its implementation methods, please refer to the above aspects and any of its implementation methods; they will not be repeated here. Attached Figure Description

[0068] Figure 1This is a diagram illustrating how a user's location is displayed in a game.

[0069] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0070] Figure 3 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application;

[0071] Figure 4 This is a schematic flowchart illustrating a method for controlling a game character provided in this application;

[0072] Figures 5 to 11 This is a schematic diagram illustrating the method of controlling a game character according to the method provided in this application;

[0073] Figure 12 This is a schematic diagram of a method for determining a safe area provided in this application;

[0074] Figure 13 A schematic flowchart illustrating a specific example of the method for controlling a game character provided in this application;

[0075] Figure 14 This is a schematic flowchart illustrating another method for controlling a game character provided in this application;

[0076] Figure 15 This is a schematic diagram illustrating the method of controlling a game character according to the method provided in this application;

[0077] Figure 16 A schematic flowchart illustrating a specific example of the method for controlling a game character provided in this application;

[0078] Figure 17 This is a schematic flowchart illustrating another method for controlling a game character provided in this application;

[0079] Figures 18 to 21 This is a schematic diagram illustrating the method of controlling a game character according to the method provided in this application;

[0080] Figure 22 A schematic flowchart illustrating a specific example of the method for controlling a game character provided in this application. Detailed Implementation

[0081] The technical solutions of the embodiments of this application are described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, "at least one" and "one or more" refer to one or more (including two). The term "and / or" is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0082] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0083] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0084] In parkour / racing track games, a common gameplay mechanic involves using a camera to detect the user's left and right movements, controlling the game character to switch tracks and avoid obstacles. In the tense and exciting environment of these games, the distance the user moves left or right each time is often different. After a period of gameplay, the cumulative deviation of the user's position from their initial position can become increasingly significant. In this situation, the user's attention is often focused on controlling the game character, thus greatly increasing the risk of collisions.

[0085] One technical solution involves using a camera to acquire the user's location and then rendering and displaying it in a small window within the game interface. By observing this window, the user can determine their approximate location, thus gaining a general understanding of their activity range and safety. For example, see... Figure 1 In the motion-sensing game "Talking Tom Gold Run" released by Huawei Smart Screen, the user's position is displayed as shown in the image. Figure 1 In the small window in the upper left corner.

[0086] However, due to the intense excitement and immersive nature of games, users focus more on controlling their characters. Even if a small window in the game interface displays the user's approximate location, it is often not immediately apparent to the user, making it difficult to prevent bumps and knocks during gameplay. Furthermore, the small window display disrupts the consistency of the visual style, creating a sense of visual fragmentation. In full-frame motion-sensing games and AR / VR games, it may even cause obstruction and interference, negatively impacting the motion-sensing gaming experience.

[0087] To address the aforementioned technical problems, this application provides a method and electronic device for controlling game characters. The technical solution provided by this application can reduce the occurrence of personal safety incidents such as bumps and collisions during motion-sensing games and AR / VR games, thus protecting the user's personal safety to a certain extent.

[0088] Figure 2 This illustration shows a structural schematic diagram of an electronic device according to an embodiment of this application. The electronic device 100 may include a camera 110, a processor 120, and a display screen 130.

[0089] Processor 120 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0090] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0091] The processor 120 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 120 is a cache memory. This memory can store instructions or data that the processor 120 has just used or that are used repeatedly. If the processor 120 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 120, and thus improves the efficiency of the system.

[0092] In some embodiments, the processor 120 may include one or more interfaces. Interfaces may include a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and / or a universal serial bus (USB) interface, etc.

[0093] The MIPI interface can be used to connect the processor 120 to peripheral devices such as the display screen 130 and the camera 110. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 120 and the camera 110 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 120 and the display screen 130 communicate via the DSI interface to enable the electronic device 100 to display images.

[0094] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 120 to the camera 110, display screen 130, etc. The GPIO interface can also be configured as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), etc.

[0095] A USB interface is an interface that conforms to the USB standard specification, specifically including Mini USB, Micro USB, and USB Type-C interfaces. A USB interface can be used to transfer data between electronic device 100 and peripheral devices. This interface can also be used to connect other electronic devices, such as AR devices.

[0096] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0097] Electronic device 100 implements display functions through a GPU, display screen 130, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 130 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 120 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0098] The display screen 130 is used to display images, videos, etc. The display screen 130 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 130, where N is a positive integer greater than 1.

[0099] Electronic device 100 can perform shooting functions through ISP, camera 110, video codec, GPU, display 130 and application processor.

[0100] The ISP (Image Signal Processor) is used to process data fed back from the camera 110. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 110.

[0101] Camera 110 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 110, where N is a positive integer greater than 1.

[0102] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0103] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0104] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0105] In this embodiment, the display screen 130 can display the game screen that the user is currently playing, such as... Figure 1 The central display screen 130 displays the game character corresponding to user A. The camera 110 can capture the user's image, and the processor 120 can display the corresponding game screen based on the image of the user captured by the camera 110.

[0106] In some embodiments, the processor 120 can determine the user's current location based on the image of the user captured by the camera 110, and guide the user to an initial location based on the user's current location and the environment (real environment) in which the user is located.

[0107] In other embodiments, the processor 120 can detect the user's current location based on the image of the user captured by the camera 110, and switch game tracks based on the user's current location.

[0108] The electronic device 100 can be a large-screen device (such as a TV), a motion-sensing game console, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or other electronic devices. This application embodiment does not impose any restrictions on the specific type of electronic device.

[0109] Figure 3 This application provides a schematic diagram of a communication system. See also... Figure 3The system 200 includes an electronic device 210 and a head-mounted display device 220 worn by a user. The electronic device 210 is a controller for the head-mounted display device 220, which can be an AR / VR device, such as AR / VR glasses. For example, the electronic device 210 and the head-mounted display device 220 can be connected via wired or wireless means (such as a Wi-Fi hotspot).

[0110] Electronic device 210 may include one or more processing units, such as an application processor (AP), a modem processor, a GPU, an ISP, a controller, memory, a video codec, a DSP, a baseband processor, and / or an NPU. These different processing units may be independent devices or integrated into one or more processors.

[0111] The controller can be the nerve center and command center of the electronic device 210. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0112] The electronic device 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the electronic device 210 is a cache memory. This memory can store instructions or data that the electronic device 210 has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces processor waiting time, and thus improves system efficiency.

[0113] In some embodiments, the electronic device 210 may include one or more interfaces. The interface may include a USB interface.

[0114] A USB interface is an interface that conforms to the USB standard specification, specifically a Mini USB interface, a Micro USB interface, a USB Type-C interface, etc. The USB interface can be used to transfer data between electronic device 210 and head-mounted display device 220.

[0115] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 210. In other embodiments of this application, the electronic device 210 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0116] The following is based on Figure 2 The solution provided in this application will be described using the structure of the electronic device shown as an example. It should be understood that in the solution described below, all positions refer to positions in the horizontal direction. For example, the middle position of the middle track refers to the middle position of the middle track in the horizontal direction.

[0117] Figure 4 This is a schematic flowchart illustrating a method for controlling a game character provided in this application. The method can be implemented using an electronic device (e.g., Figure 2 The electronic device 100 shown or Figure 3 The method 400, executed by the electronic device 210 shown, may include S410 to S430.

[0118] S410, determine whether the game character will switch to the initial track.

[0119] For example, if the number of game tracks is odd, the initial track can be one of the middle tracks. If the number of game tracks is even, the initial track can be one of the two middle tracks.

[0120] In one example, if the game character is located on the left / right adjacent track of the initial track before frame s, and the user moves a distance L to the right / left within consecutive frames s greater than a threshold T, the electronic device determines to switch the game character to the initial track.

[0121] The threshold T can be an empirical value or it can be adaptively adjusted based on parameters such as the user's height, leg length, and / or activity level (step length).

[0122] In another example, if the game character is located on the second track to the left / right of the initial track before frame s, and the user moves a distance L to the right / left within consecutive frames s greater than a threshold T', then the electronic device determines to switch the game character back to the initial track. Here, T' = 2T.

[0123] S420: Obtain the first distance when the game character switches to the initial track.

[0124] The first distance is the horizontal distance between the user's current location and the user's initial location. The game character corresponding to the user's initial location is located in the middle of the initial track in the horizontal direction; that is, when the user is at their initial location, the game character is located in the middle of the initial track in the horizontal direction.

[0125] S430, if the first distance is greater than a first preset threshold, and the user's current position is to the left of the user's initial position, the game character is switched to the first area; if the user's current position is to the right of the user's initial position, the game character is switched to the second area. If the first distance is less than or equal to the first preset threshold, the game character is switched to the middle position of the initial track in the horizontal direction. Both the first and second areas are located within the initial track, with the first area located to the left of the initial track and the second area located to the right of the initial track.

[0126] For example, the first region and the second region have no overlap.

[0127] For ease of description, the first preset threshold will be denoted as αT in the following text, where 0 < α < 1. For example, α can be determined empirically.

[0128] Specifically, in scenarios where the game character is about to switch to the initial track, and the horizontal distance between the user's current position and the initial position is greater than αT, if the user's current position is to the left of the initial position, the game character is switched to the left side of the initial track; if the user's current position is to the right of the initial position, the game character is switched to the right side of the initial track. In scenarios where the game character is about to switch to the initial track, and the horizontal distance between the user's current position and the initial position is less than or equal to αT, the game character is switched to the middle position of the initial track in the horizontal direction.

[0129] Based on this solution, the game character can be switched to a corresponding position on the initial track according to the user's current location and the distance between the current location and the initial location. This guides the user to adjust their position based on visual feedback, thus mitigating safety issues such as collisions caused by cumulative deviations. Furthermore, this solution does not require altering the game mechanics or disrupting the game visuals, thereby affecting the user's gaming experience.

[0130] The following assumes α = 0.2, combined with Figures 5 to 8 Let's illustrate with examples.

[0131] For example, Figure 5 A schematic diagram of a scenario is shown, illustrating a method for controlling a game character according to the method provided in this application.

[0132] See Figure 5 The left half of the initial track (i.e., track B) is the first area. The right half of track B is the second area. When the user starts the game, they are in the initial position, and their corresponding game character is in the middle of track B. Within the next s frames after the game starts, the user moves 1.5T to the left, which is the position shown as t in the diagram. s At frame position t, the electronic device switches the game character to the left, moving them to track A. Then, within consecutive frames s, the user moves 1.2T to the right, which is the position shown as t in the diagram. 2sBased on the frame position, the electronic device determines that the game character will switch to track B to the right. Track B is the initial track, so the electronic device detects the horizontal distance between the user's current position and the user's initial position (i.e., the first distance), which is 0.3T. Since 0.3T > αT, and the user's current position is to the left of the user's initial position, the electronic device can switch the game character to the first area. Through this visual cue, the user understands that switching to track A to the left requires a shorter distance, while switching to track C to the right requires a longer distance, thus guiding the user to always move closer to the initial position during left and right movements.

[0133] For example, Figure 6 A schematic diagram of a scenario is shown, illustrating a method for controlling a game character according to the method provided in this application.

[0134] See Figure 6 The leftmost third of the initial track (i.e., track B) is designated as the first zone, and the rightmost third as the second zone. When the user starts the game, they are in the initial position, and their character is in the middle of track B. Within the next s frames after the game begins, the user moves 1.5T to the left, which is the position shown as t in the diagram. s At frame position t, the electronic device switches the game character to the left, moving them to track A. Then, within consecutive frames s, the user moves 1.2T to the right, which is the position shown as t in the diagram. 2s Based on the frame position, the electronic device determines that the game character will switch to track B to the right. Track B is the initial track, so the electronic device detects the horizontal distance between the user's current position and the user's initial position (i.e., the first distance), which is 0.3T. Since 0.3T > αT, and the user's current position is to the left of the user's initial position, the electronic device can switch the game character to the first area. Through this visual cue, the user understands that switching to track A to the left requires a shorter distance, while switching to track C to the right requires a longer distance, thus guiding the user to always move closer to the initial position during left and right movements.

[0135] For example, Figure 7 A schematic diagram of a scenario is shown, illustrating a method for controlling a game character according to the method provided in this application.

[0136] See Figure 7 ,and Figure 5 The division method shown is the same: the left half of the initial track (i.e., track B) is the first area. The right half of track B is the second area. Within s consecutive frames after the start of the game, the user moves 1.5T to the left, that is, moves to the position shown as t in the diagram. sAt frame position t, the electronic device switches the game character to the left, moving them to track A. Then, within consecutive frames s, the user moves 1.6T to the right, which is the position shown as t in the diagram. 2s Based on the frame position, the electronic device determines that the game character will switch back to track B to the right. Track B is the initial track, so the electronic device detects the horizontal distance between the user's current position and the user's initial position (i.e., the first distance), which is 0.1T. Since 0.1T < αT, the game character is switched to the middle position of track B in the horizontal direction. Through this visual cue, the user understands that switching to track C to the right and switching to track A to the left does not require moving a large distance, thus guiding the user to always move closer to the initial position during left and right movements.

[0137] For example, Figure 8 A schematic diagram of a scenario is shown, illustrating a method for controlling a game character according to the method provided in this application.

[0138] See Figure 8 ,and Figure 6 The division method shown is the same: the leftmost 1 / 3 of the initial track (i.e., track B) is the first region, and the rightmost 1 / 3 is the second region. Furthermore, the middle 1 / 3 of track B is the third region. When the user starts the game, they are in the initial position, and the corresponding game character is in the middle of track B. Within s consecutive frames after the game starts, the user moves 1.5T to the left, that is, moves to position t as shown in the diagram. s At frame position t, the electronic device switches the game character to the left, moving them to track A. Then, within consecutive frames s, the user moves 1.6T to the right, which is the position shown as t in the diagram. 2s Based on the frame position, the electronic device determines that the game character will switch to track B to the right. Track B is the initial track, so the electronic device detects the horizontal distance between the user's current position and the user's initial position (i.e., the first distance), which is 0.1T. Since 0.1T < αT, the game character is switched to the middle position of track B, which is the third area. Through this visual cue, the user knows that switching to track C to the right and switching to track A to the left does not require moving a long distance, thus guiding the user to always move closer to the initial position during left and right movements.

[0139] Optionally, as an embodiment of this application, a first facility is provided in the first area and / or the second area, the first facility being used to slow down the game character. Exemplarily, the first facility is a roadblock or speed bump (such as bushes or sand belts). It should be understood that the first facility can also be other facilities that can slow down the game character.

[0140] Specifically, in scenarios where the game character is about to switch to the initial track, and the horizontal distance between the user's current position and the user's initial position is greater than αT, if the user's current position is to the left of the initial position, the game character will be switched to the left side of the initial track where the first facility is located; if the user's current position is to the right of the initial position, the game character will be switched to the right side of the initial track where the first facility is located. In scenarios where the game character is about to switch to the initial track, and the horizontal distance between the user's current position and the user's initial position is less than or equal to αT, the game character will be switched to the middle position of the initial track.

[0141] For example, throughout the game, both the first and second zones have a first facility. This is for instance, when the sum of the widths of the first and second zones is less than the width of the initial track (e.g., ...). Figure 6 As shown in the division of the first and second areas, facilities can be set up in both areas throughout the game.

[0142] For example, the first facility is only set up in the first or second zone when switching game tracks. This is for instance, when the sum of the widths of the first and second zones equals the width of the initial track (e.g., as shown in the example). Figure 5 As shown in the division of the first and second areas, when it is necessary to switch the game character to the first area, the first facility can be set up in the first area, and when it is necessary to switch the game character to the second area, the first facility can be set up in the second area.

[0143] Based on this solution, when the user's position exceeds a certain distance from the initial position, the game character can be displayed at the edge of the initial track, thus causing a deceleration effect. When the user's position is within a certain distance of the initial position, the game character can be displayed in the middle of the initial track. In this case, the game character is displayed normally without any deceleration effect, allowing the user to know that they are near the initial position. This automatic adjustment of the game screen display guides the user back to the initial position, thereby avoiding safety issues such as collisions caused by cumulative deviation to a certain extent. Furthermore, this solution does not require changing the game mechanics, nor does it disrupt the game visuals or affect the user's gaming experience.

[0144] Taking α = 0.2 as an example again, combined with Figure 9 The above embodiments are illustrated by examples.

[0145] See Figure 9Speed ​​bumps can be placed on the left edge (i.e., the first area) and right edge (i.e., the second area) of the initial track B. The middle part of track B is the third area, which does not have speed bumps or other facilities from the first area. When the user starts the game, they are in the initial position, and their corresponding game character is in the middle of track B. Within s consecutive frames after the game starts, the user moves 1.5T to the left, that is, moves to the position shown as t in the diagram. s At frame position t, the electronic device switches the game character to the left, moving them to track A. Then, within consecutive frames s, the user moves 1.2T to the right, which is the position shown as t in the diagram. 2s Based on the frame position, the electronic device determines that the game character will switch to track B to the right. Since the first distance 0.3T is greater than αT, and the user's current position is to the left of the user's initial position, the electronic device can switch the game character to the first area. After the game character switches to the first area, the game character will decelerate, allowing the user to know that they are far from the initial position. This allows the user to make small adjustments to move closer to the initial position, controlling the game character to return to the middle of the initial track, while simultaneously moving towards the initial position themselves.

[0146] Additionally, in scenarios where the game character is about to switch to the initial track, and the horizontal distance between the user's current position and the user's initial position is less than or equal to αT, for example, in a game track setting like this... Figure 9 As shown, the game character can be switched to the third area shown in the image. When the game character is in the middle of the initial track, the game character is displayed normally and there is no deceleration effect, so the user knows that it is near the initial position.

[0147] Optionally, as an embodiment of this application, the game track is set to have uneven edges (e.g., sunken or raised), wherein setting the game track to have uneven edges is used to create a shaking effect for the game character in the first or second area.

[0148] Based on this scheme, when the user's position exceeds a certain distance from the initial position, the game character can be displayed at the edge of the initial track (i.e., the first or second zone), creating a swaying effect. When the user's position is within a certain distance of the initial position, the game character can be displayed in the middle of the initial track. In this case, the game character is displayed normally without swaying, allowing the user to know that they are near the initial position. This automatic adjustment of the game screen display guides the user back to the initial position, thus mitigating safety issues such as collisions caused by cumulative deviation. Furthermore, this scheme does not require altering the game mechanics or disrupting the game visuals, thus not affecting the user's gaming experience.

[0149] Taking α = 0.2 as an example again, combined with Figure 10 Let's illustrate with examples.

[0150] See Figure 10 The leftmost third of the initial track (i.e., track B) is the first region, the rightmost third is the second region, and the middle third is the third region. The game track can be set to have uneven edges. When the user starts the game, they are in the initial position, and the corresponding game character is in the middle of the initial track B. Within s consecutive frames after the game starts, the user moves 1.5T to the left, i.e., moves to the position shown as t in the diagram. s At frame position t, the electronic device switches the game character to the left, moving them to track A. Then, within consecutive frames s, the user moves 1.2T to the right, which is the position shown as t in the diagram. 2s Based on the frame position, the electronic device determines that the game character will switch to track B to the right. Since the first distance 0.3T is greater than αT, and the user's current position is to the left of the user's initial position, the electronic device can switch the game character to the left edge of track B (i.e., the first area). After the game character switches to the left edge of track B, the game character will sway, allowing the user to know that they are far from the initial position. This allows the user to make small adjustments to move closer to the initial position, controlling the game character to return to the middle of the initial track, while simultaneously moving towards the initial position themselves.

[0151] Additionally, in scenarios where the game character is about to switch to the initial track, and the horizontal distance between the user's current position and the user's initial position is less than or equal to αT, for example, in a game track setting like this... Figure 10 As shown, the game character can be switched to the third area shown in the image. When the game character is in the middle of the initial track, the game character is displayed normally without any shaking effect, allowing the user to know that it is near the initial position.

[0152] Optionally, as an embodiment of this application, the method may further include: if the first distance is greater than a second preset threshold, setting the first track as an unavailable track and generating a second track. Wherein, if the user's current position is to the left of the initial position, the first track is the leftmost track in the current game track, and the second track is the right adjacent track of the rightmost track in the current game track; if the user's current position is to the right of the initial position, the first track is the rightmost track in the current game track, and the second track is the left adjacent track of the leftmost track in the current game track. Wherein, the second preset threshold is greater than 0 and less than 1.

[0153] Specifically, if the distance to the user's current location is greater than the second preset threshold, and the user's current location is to the left of the user's initial location, the leftmost track in the current game track is set to an unavailable track, and a new track is generated on the rightmost side of the current game track. Conversely, if the user's current location is to the right of the user's initial location, the rightmost track in the current game track is set to an unavailable track, and a new track is generated on the leftmost side of the current game track. In other words, if the distance to the user's current location is to the left of the user's initial location, the game track is shifted one track to the right; if the user's current location is to the right of the user's initial location, the game track is shifted one track to the left.

[0154] For example, roadblocks can be set up on the first track to make it unavailable.

[0155] For example, the second preset threshold may be equal to or different from the first preset threshold; for instance, the second preset threshold may be greater than the first preset threshold.

[0156] Based on the above solution, by combining the user's current location and the distance between the user and the initial position, the game automatically provides feedback based on the game mechanics. Without changing the game mechanics or disrupting the consistency of the game experience, the system can guide the user to continuously move closer to the initial position during the game, thereby avoiding dangerous situations such as collisions caused by cumulative deviation.

[0157] Taking α = 0.2 and the second preset threshold as 0.5 as an example, combined with Figure 11 Let's illustrate with examples.

[0158] See Figure 11 In (A), it is assumed that after a period of motion-sensing gameplay, the user moves 1.1T to the left within s consecutive frames to reach t. n Frame position, t n The frame position is located 0.8T to the left of the initial position. Since 0.8T > αT, the game character can be switched to the left region of track B (i.e., the initial track) (i.e., an example of the first region). Furthermore, since the first distance 0.8T is greater than the second preset threshold, the game track can be automatically adjusted at this time. See also... Figure 11 In step (B), roadblocks can be placed on the leftmost track A, while a new track D is generated on the rightmost track. This is equivalent to shifting the entire track to the right (from track ABC to track BCD). In subsequent gameplay, the user will move to the right to control the game character to switch tracks to the right. Assuming the user moves 1.2T to the right, meaning the game character returns to track t as shown in the diagram... n+sIf the frame position is determined, the user will be switched to the right side of the initial track (which is now track C) (i.e., an example of the second area). Since the user is now 0.4T to the right of the initial position, the game character will switch to the middle position of track C. It can be seen that the user has returned to a position 0.4T to the right of the initial position, thus achieving the purpose of guiding the user closer to the initial position.

[0159] The previous section introduced the content related to switching tracks. The following section explains the safe zone related to the user's initial position.

[0160] Optionally, as one embodiment of this application, the user's initial position is within a safe area presented on the display screen before the game starts.

[0161] Once the safe zone is displayed on the screen, users can stand anywhere within the safe zone to start the game. For example, after determining their position, users can confirm their position through a specific gesture or voice and start the game; this position will be the user's initial position.

[0162] Based on this solution, users can avoid standing in positions prone to collisions from the outset, thereby reducing the risk of collisions caused by deviations in the user's initial position.

[0163] In one example, the security zone is determined based on the user's environment.

[0164] Before a user enters the game, the electronic device can capture images of the user's real-time environment via a camera, detecting a safe play area. This includes excluding areas near obstacles such as tables, chairs, and coffee tables. Based on the specific play area required for the game, a final safe zone suggestion is provided. The user can then start the game standing within this safe zone, where the corresponding game character is positioned horizontally in the middle of the initial track.

[0165] For example, such as Figure 12 A schematic diagram of a scenario for determining a safe zone is shown. See also Figure 12 The electronic device's camera captures and displays an image of the user's real-world environment on the screen, determining the area between the coffee table and sofa as a safe zone based on this image. After determining the safe zone, the electronic device can use various reasonable methods to indicate its boundaries to the user. The user then stands within the safe zone according to the electronic device's prompts to begin the game. It should be understood that the user's initial position is within this safe zone.

[0166] Based on this scheme, electronic devices can detect the real-world environment, eliminating locations near obstacles. Combined with the activity range required for the specific game, a final safe activity range can be determined, within which the device can suggest an initial position for the user. The safe zone determined by this method is relatively reliable, avoiding the risk of collisions caused by deviations in the user's initial position.

[0167] In another example, if the environment does not meet the requirements for safe gaming, the electronic device can prompt the user that the environment is not safe for them to play the game, or it can prompt the user to clean up the environment, or it can prevent the user from entering the game.

[0168] In yet another example, the security zone is a safe area set with the center of the electronic device's display screen as the center.

[0169] In another example, the safe zone is a safe area set centered on the user's initial standing position.

[0170] For example, Figure 13 An exemplary flowchart of a method for controlling a game character is shown. This method can be performed by the aforementioned electronic device. The method 500 may include one or more of the steps described below.

[0171] S501, Identify and display the safe zone.

[0172] The safe zone can be determined using any of the methods mentioned above. After the safe zone is determined, the electronic device's control display shows the range of the safe zone to guide the user to their initial position.

[0173] S502, determine the user's initial position.

[0174] Users can freely choose their position within a safe area. For example, they can also confirm their position and start the game through specific gestures or voice commands. This position is the user's initial location.

[0175] S503 detects whether the user's location is outside the safe zone.

[0176] The user begins the game, and the screen displays the game screen. During the game, the camera can detect the user's position frame by frame or skip frames. If the user's position is found to be outside the aforementioned safe area, S504b can be executed, which pauses the game until the user repositions themselves. The game then resumes, and the user's initial position is refreshed. If the user's position is within the aforementioned safe area, the game continues.

[0177] S504a, determines whether the game character will switch tracks.

[0178] During gameplay, the electronic device detects whether the distance L that the user moves in a certain direction (i.e., left or right) within consecutive s frames is greater than a threshold T. If so, it is recognized as a valid game command input.

[0179] It should be understood that an even larger threshold could also be set here to allow the player character to switch between two tracks consecutively.

[0180] S504b, pause the game.

[0181] As mentioned earlier, if a user's position exceeds the aforementioned safe zone, the game can be paused until the user repositions themselves. The game will then resume and the user's initial position will be refreshed.

[0182] It should be understood that this application does not limit the order of S503, S504a, and S504b, and these three are executed in a logical order.

[0183] S505, determines whether the game character will switch to the initial track.

[0184] If it is detected in S504a that the game character will switch tracks, then it is determined whether the game character will switch to the initial track. If not, the electronic device executes S506b, that is, switches the game character to the track in the corresponding direction. If yes, then S506a is executed.

[0185] It should be understood that the combination of S504a and S505 here is one implementation of the aforementioned S410.

[0186] S506a, determine whether the first distance is greater than the first preset threshold αT.

[0187] Specifically, a first distance is obtained and it is determined whether the user is currently at a position greater than αT to the left or right of their initial position.

[0188] S506b switches the game character to the track in the corresponding direction.

[0189] If S505 detects that the game character will switch to a track other than the middle track, then the game character will be switched to the track in the corresponding direction.

[0190] S507a, if the first distance is greater than the first preset threshold αT, then execute measure one.

[0191] S507b, if the first distance is less than or equal to the first preset threshold αT, then execute measure two.

[0192] In the first example, the first measure is: if the user's current location is to the left of the user's initial location, switch the game character to the first area; if the user's current location is to the right of the user's initial location, switch the game character to the second area. Both the first and second areas are located within the initial track area, with the first area to the left of the initial track and the second area to the right. For example, see [link to example]. Figure 5 and Figure 6 The scene diagram is shown. Accordingly, measure two is to switch the game character to the middle position of the initial track. For example, see... Figure 7 and Figure 8 The scene diagram shown.

[0193] In the second example, measure one is: if the user's current location is to the left of the user's initial location, the game character is switched to the first area; if the user's current location is to the right of the user's initial location, the game character is switched to the second area. Both the first and second areas are located within the initial track area, with the first area to the left and the second area to the right. Furthermore, the first and / or second areas are equipped with a first facility used to slow down the game character. For example, see [link to example]. Figure 9 The scene diagram is shown. Accordingly, measure two is to switch the game character to the middle position of the initial track.

[0194] In the third example, measure one is: if the user's current location is to the left of the user's initial location, switch the game character to the first area; if the user's current location is to the right of the initial location, switch the game character to the second area. Both the first and second areas are located within the initial track area, with the first area to the left and the second area to the right. Furthermore, the game track is set to have uneven edges to create a swaying effect for the game character when in the first or second area. For example, see [link to example]. Figure 10 The scene diagram is shown. Accordingly, measure two is to switch the game character to the middle position of the initial track.

[0195] It should be understood that the first to third examples here can be found in the descriptions of the corresponding sections above, and will not be repeated here.

[0196] Furthermore, for any one of the first to third examples, if the first distance is greater than or equal to the second preset threshold, the leftmost track in the current game track can be set as an unavailable track, and a new track can be generated on the rightmost side of the current game track; if the user's current position is to the right of the user's initial position, the rightmost track in the current game track is set as an unavailable track, and a new track is generated on the leftmost side of the current game track. For example, see [link to relevant documentation]. Figure 11 The scene diagram shown.

[0197] Based on Method 500, the probability of personal safety incidents such as bumps and knocks during gameplay can be reduced, thereby improving the user's gaming experience.

[0198] Figure 14 This is a schematic flowchart illustrating another method for controlling a game character provided in this application. This method can be implemented using an electronic device (e.g., Figure 2 The electronic device 100 shown or Figure 3 The method 600, executed by the electronic device 210 shown, may include S610 to S640.

[0199] S610, determines whether the game character will switch to the initial track.

[0200] This step is the same as S410; please refer to S410 for details. Additionally, the meaning of the initial track can be found in the description of the initial track in Method 400, and will not be repeated here.

[0201] S620: When the game character is about to switch to the initial track, switch the game character to the initial track.

[0202] S630, obtain the first distance.

[0203] The meaning of the first distance can be found in the description in method 400.

[0204] S640, if the first distance is greater than the second preset threshold, sets the first track as an unavailable track and generates a second track.

[0205] Specifically, if the user's current location is to the left of their initial location, the first track is the leftmost track in the current game track, and the second track is the right adjacent track of the rightmost track in the current game track. If the user's current location is to the right of their initial location, the first track is the rightmost track in the current game track, and the second track is the left adjacent track of the leftmost track in the current game track. The second preset threshold is greater than 0 and less than 1. For example, the second preset threshold can be determined based on experience.

[0206] Specifically, if the distance to the user's current location is greater than the second preset threshold, and the user's current location is to the left of the user's initial location, the leftmost track in the current game track is set to an unavailable track, and a new track is generated on the rightmost side of the current game track. Conversely, if the user's current location is to the right of the user's initial location, the rightmost track in the current game track is set to an unavailable track, and a new track is generated on the leftmost side of the current game track. In other words, if the distance to the user's current location is to the left of the user's initial location, the game track is shifted one track to the right; if the user's current location is to the right of the user's initial location, the game track is shifted one track to the left.

[0207] For example, roadblocks can be set up on the first track to make it unavailable.

[0208] Based on the above solution, by combining the user's current location and the distance between the user and the initial position, the game automatically provides feedback based on the game mechanics. Without changing the game mechanics or disrupting the consistency of the game experience, the system can guide the user to continuously move closer to the initial position during the game, thereby avoiding dangerous situations such as collisions caused by cumulative deviation.

[0209] Taking a second preset threshold of 0.5 as an example, combined with Figure 15 Let's illustrate with examples.

[0210] See Figure 15 In (A), assuming that after a period of motion-sensing gameplay, the user's character has returned to track B (i.e., the initial track), but the user's current position (i.e., t as shown in the diagram) is... n The cumulative offset between the frame position and the initial position has reached 0.8T. Since the first distance of 0.8T is greater than the second preset threshold, the game track can be automatically adjusted at this point. See also Figure 15 In step (B), roadblocks can be placed on the leftmost track A, while a new track D is generated on the rightmost track. This is equivalent to shifting the entire track to the right (from track ABC to track BCD). In subsequent gameplay, the user will move to the right to control the game character to switch tracks to the right. Assuming the user moves 1.2T to the right, meaning the game character returns to track t as shown in the diagram... n+s At the specified frame position, the game character will switch to track C. It can be seen that the user has returned to a position 0.4T to the right of the initial position, thus achieving the goal of guiding the user closer to the initial position.

[0211] It should be noted that methods 400 and 600 can also be used in combination. For example, a second preset threshold can be set to be greater than the first preset threshold. When the game character is about to switch to the initial track, if the first distance is less than or equal to the second preset threshold, then S430 in method 400 is executed; otherwise, S620 and S640 in method 600 are executed.

[0212] It should also be noted that the solutions related to security zones mentioned above are also applicable to Method 600, and will not be repeated here.

[0213] For example, Figure 16 An exemplary flowchart of a method for controlling a game character is shown. This method can be performed by the aforementioned electronic device. The method 700 may include one or more of the steps described below.

[0214] S710 identifies and displays a safe zone.

[0215] S702, determine the user's initial position.

[0216] S703 detects whether the user's location is outside the safe zone.

[0217] S704a, determines whether the game character will switch tracks.

[0218] S704b, pause the game.

[0219] It should be understood that steps S701 to S704b are the same as S501 to S504b, and you can refer to S501 to S504b for details.

[0220] S705, switch the game character to the target track.

[0221] If it is detected in S704a that the game character will switch tracks, then the game character will be switched to the track that the game character will switch to, i.e., the target track.

[0222] S706, determine whether the target track is the initial track.

[0223] S707, determine whether the first distance is greater than the second preset threshold.

[0224] Specifically, if the target track is determined to be the initial track in S706, then it is determined whether the first distance is greater than the second preset threshold; otherwise, the process returns to step S704a or S703.

[0225] S708 sets the first track to an unavailable track and generates a second track.

[0226] Specifically, if it is determined in S707 that the first distance is greater than the second preset threshold, the first track is set as an unavailable track and a second track is generated.

[0227] For details of step S708, please refer to S640.

[0228] Based on this solution, by combining the user's current location and the distance between the user and the initial position, the game automatically provides feedback based on the game mechanics. Without changing the game mechanics or disrupting the consistency of the game experience, it can guide the user to continuously move closer to the initial position during the game, thereby avoiding dangerous situations such as collisions caused by cumulative deviation.

[0229] Figure 17 This is a schematic flowchart illustrating a method for controlling a game character provided in this application. The method 800 may include steps S810 to S830.

[0230] S810, the electronic device determines whether the game character will switch game tracks.

[0231] In one example, if the user moves a distance L to the left or right within s consecutive frames greater than a threshold T, the electronic device determines to switch the game character to an adjacent track in the corresponding direction. If the user moves a distance less than or equal to the threshold T to the left or right within s consecutive frames, the electronic device determines to keep the game character on the same track.

[0232] The threshold T can be an empirical value or it can be adaptively adjusted based on the user's height, leg length, and / or activity level (step length).

[0233] In another example, if the user moves a distance L to the left / right within consecutive frames s greater than a threshold T', the electronic device determines to switch the game character between two tracks in the corresponding direction. Here, T' = 2T.

[0234] It should be understood that the difference between steps S810 and S410 is that S810 determines whether to switch game tracks, while S410 determines whether to switch back to the initial track.

[0235] S820, when the game character switches game tracks, obtains the first distance.

[0236] The first distance is the horizontal distance between the user's current location and their initial location. The game character corresponding to the user's initial location is located in the middle of the initial track in the horizontal direction; that is, when the user is at their initial location, the game character is located in the middle of the initial track in the horizontal direction.

[0237] For example, if the number of game tracks is odd, the initial track can be one of the middle tracks. If the number of game tracks is even, the initial track can be one of the two middle tracks.

[0238] S830, based on the first distance, switches the game character to the corresponding position on the target track.

[0239] Specifically, if the first distance is greater than a preset threshold corresponding to the target track, and the user's current position is to the left of the user's initial position, the game character is switched to the first area; if the user's current position is to the right of the user's initial position, the game character is switched to the second area. If the target track is not the initial track, and the first distance is less than or equal to the preset threshold corresponding to the target track, if the user's current position is to the left of the user's initial position, the game character is switched to the second area or the middle position of the target track horizontally; if the user's current position is to the right of the user's initial position, the game character is switched to the first area or the middle position of the target track horizontally. If the target track is the initial track, and the first distance is less than or equal to the preset threshold corresponding to the target track, the game character is switched to the middle position of the target track horizontally. Both the first and second areas are located within the target track area, with the first area to the left of the target track and the second area to the right of the target track. For example, the first and second areas do not overlap.

[0240] The target track is the track the game character will switch to. For example, in a scenario where only one track can be switched consecutively, if the user moves a distance L to the left within s consecutive frames greater than a threshold T, the target track is the left adjacent track of the current track; if the user moves a distance L to the right within s consecutive frames greater than the threshold T, the target track is the right adjacent track of the current track. Similarly, in a scenario where two tracks can be switched consecutively, if the user moves a distance T' to the left within s consecutive frames greater than a threshold T, the target track is the second track to the left of the current track; if the user moves a distance T' to the right within s consecutive frames greater than the threshold T, the target track is the second track to the right of the current track.

[0241] Each track (game track) corresponds to a preset threshold, which can be determined based on experience. The initial track corresponds to a preset threshold αT, where 0 < α < 1. The left and right adjacent tracks of the initial track correspond to preset thresholds βT, where 1 < β < 2. The second track to the left and the second track to the right of the initial track correspond to preset thresholds γT, where 2 < γ < 3. The preset thresholds for other tracks follow the same pattern.

[0242] Specifically, in scenarios where the game character is about to switch game tracks and the horizontal distance between the user's current position and the user's initial position is greater than a preset threshold corresponding to the target track, if the user's current position is to the left of the user's initial position, the game character will be switched to the left side of the target track; if the user's current position is to the right of the user's initial position, the game character will be switched to the right side of the target track. In scenarios where the game character is about to switch game tracks and the horizontal distance between the user's current position and the user's initial position is less than or equal to a preset threshold corresponding to the target track, there are two situations: (1) The target track is not the initial track. In this case, if the user's current position is to the left of the user's initial position, the game character will be switched to the right side of the target track or the middle position of the target track in the horizontal direction; if the user's current position is to the right of the user's initial position, the game character will be switched to the left side of the target track or the middle position of the target track in the horizontal direction. (2) The target track is the initial track. In this case, the game character will be switched to the middle position of the target track in the horizontal direction.

[0243] Based on this solution, the user's position and movement distance are cleverly integrated into the game screen. Visual feedback guides the user to adjust their position, thus mitigating safety issues such as collisions caused by cumulative deviation. Furthermore, this solution does not alter the game mechanics or disrupt the visuals, thus preserving the user's gaming experience.

[0244] For example, if the target track is the initial track, see method 400.

[0245] For example, Figure 18 The diagram illustrates a scenario where a game character is controlled according to the method provided in this application. The preset threshold for track C is 1.3T, and the preset threshold for track B is 0.2T.

[0246] See Figure 18 In (A), the user starts the game at the initial position, and the corresponding game character is in the middle of track B (i.e., the initial track). Within the next s frames after the game starts, the user moves 1.5T to the right, which is the position shown as t in the diagram. sIf the frame position is such that the game character needs to be switched to track C (i.e., an example of the target track), then the game character needs to be switched to track C. Since the horizontal distance between the user's current position and the user's initial position (i.e., the first distance) is 1.5T, which is greater than the preset threshold of 1.3T corresponding to track C, and the user's current position is to the right of the user's initial position, the game character is switched to the right side of track C, i.e., area 1 in the figure (an example of the second area). Through this visual cue, the user can understand that to switch to track B (i.e., the initial track) to the left, a longer distance needs to be moved, thus guiding the user to always move closer to the initial position during left and right movements.

[0247] See Figure 18 In (B), the user moves from t within consecutive s frames. s The frame position shifted 1.9T to the left, that is, to position t as shown in the figure. 2s If the frame position is such that the game character needs to be switched to track B (i.e., an example of the target track), then the game character needs to be switched to track B. Since the horizontal distance between the user's current position and the user's initial position (i.e., the first distance) is 0.4T, which is greater than the preset threshold of 0.2T corresponding to track B, and the user's current position is to the left of the user's initial position, the game character is switched to the left of track C, i.e., area 2 in the figure (an example of the first area).

[0248] For example, Figure 19 A schematic diagram of a scenario is shown, illustrating the method for controlling a game character according to the present application. The preset threshold for track C is 1.3T.

[0249] See Figure 19 When the user starts the game, they are in the initial position, and their game character is in the middle of track B (i.e., the initial track). Within the first s frames of the game, the user moves 1.2T to the right, which is the position shown as t in the diagram. s If the frame position is such that the game character needs to be switched to track C (i.e., an example of the target track), then the game character needs to be switched to track C. Since the horizontal distance between the user's current position and their initial position (i.e., the first distance) is 1.2T, which is less than the preset threshold of 1.3T for track C, the game character can be switched to the middle position of track C. Alternatively, the game character can be switched to the left side of track C, i.e., area 3 in the diagram. Through this visual cue, the user doesn't need to move a large distance to switch to track B the next time they switch tracks, thus guiding the user to always move closer to their initial position during left and right movements.

[0250] Optionally, as an embodiment of this application, a first facility is provided in the first area and / or the second area, the first facility being used to slow down the game character. Exemplarily, the first facility is a roadblock or speed bump (such as bushes or sand belts). It should be understood that the first facility can also be other facilities that can slow down the game character.

[0251] For example, throughout the game, both the first and second areas have a first facility. For instance, for any track, if the sum of the widths of the first and second areas of that track is less than the width of the track itself (e.g., ... Figure 6 As shown in the diagram of the first and second zones, facilities can be set up in both the first and second zones of the track throughout the game.

[0252] For example, the first facility will only be set up in the first or second area when switching game tracks. This is for instance, if the sum of the widths of the first and second areas of a track is less than the width of the track itself (e.g., ...). Figure 5 As shown in the division of the first and second zones, when it is necessary to switch the game character to the first zone of the track, a first facility can be set up in the first zone of the track, and when it is necessary to switch the game character to the second zone of the track, a first facility can be set up in the second zone of the track.

[0253] Based on this scheme, when the distance between the user's position and the initial position (i.e., the first distance) exceeds a preset threshold corresponding to the game track, the game character can be displayed at the edge of the track, thus causing the character to slow down. This automatic adjustment of the game screen display guides the user back to the initial position, thereby mitigating safety issues such as collisions caused by cumulative deviation. Furthermore, this scheme does not require altering the game mechanics or disrupting the game visuals, thus not affecting the user's gaming experience.

[0254] It should be understood that when the distance between the user's position and the initial position is less than or equal to the preset threshold corresponding to the game track, if the game character is displayed in the middle position of the initial track, that is, the game character is displayed normally, there will be no deceleration effect, so the user can know that he is near the initial position.

[0255] For example, if the target track is the initial track, you can refer to Figure 9 .

[0256] For example, Figure 20 A schematic diagram of a scenario is shown, illustrating the method for controlling a game character according to the present application. The preset threshold for track C is 1.3T.

[0257] See Figure 20Speed ​​bumps can be placed along the left and right edges of each track. When the user starts the game, their character is in the middle of the initial track B. Within the first s frames after the game starts, the user moves 1.5T to the right, which is the position shown as t in the diagram. s If the frame position is such that the game character needs to be switched to track C (i.e., an example of the target track), then the game character needs to be switched to track C. Since the horizontal distance between the user's current position and their initial position (i.e., the first distance) is 1.5T, which is greater than the preset threshold of 1.3T for track C, and the user's current position is to the right of their initial position, the game character is switched to the right edge of track C, i.e., region 1 in the diagram (an example of the second region). After the game character is switched to the right edge of track C, the game character will slow down. This allows the user to know that they are far from their initial position, and thus they can use small steps to move closer to the initial position, controlling the game character to return to the middle of the initial track. Simultaneously, the user is also moving closer to their initial position.

[0258] Optionally, as an embodiment of this application, the game track is set to have uneven edges, wherein setting the game track to have uneven edges is used to cause the game character to have a shaking effect in the first or second area.

[0259] Based on this solution, the game character can exhibit a swaying effect when positioned at the edge of the track. This automatic adjustment of the game screen guides the user back to their initial position, mitigating safety issues such as collisions caused by accumulated deviation. Furthermore, this solution does not alter the game mechanics or disrupt the visuals, thus preserving the user's gaming experience.

[0260] It should be understood that when the distance between the user's position and the initial position is less than or equal to the preset threshold corresponding to the game track, if the game character is displayed in the middle position of the initial track, that is, the game character is displayed normally, there will be no shaking effect, so the user can know that he is near the initial position.

[0261] For example, if the target track is the middle track, you can refer to... Figure 10 .

[0262] For example, Figure 21 A schematic diagram of a scenario is shown, illustrating the method for controlling a game character according to the present application. The preset threshold for track C is 1.3T.

[0263] See Figure 21The game track can be set to have uneven edges. When the user starts the game, their initial position corresponds to the game character being in the middle of the initial track B. Within the next s frames after the game starts, the user moves 1.2T to the right, which is the position shown as t in the diagram. s If the frame position is correct, then the game character needs to be switched to track C. Since the horizontal distance between the user's current position and initial position (i.e., the first distance) is 1.2T, which is less than the preset threshold of 1.3T for track C, and the user's current position is to the right of the initial position, the game character is switched to the left edge of track C, i.e., area 2 in the diagram (an example of the first area). After the game character is switched to the left edge of track C, the game character will sway, allowing the user to know that they are far from their initial position. This allows the user to adjust their movements slightly to move closer to the initial position, controlling the game character to return to the center of the track. Simultaneously, the user is also moving closer to their initial position.

[0264] It should be noted that the solutions related to security zones mentioned above are also applicable to Method 800, and will not be repeated here.

[0265] For example, Figure 22 An exemplary flowchart of a method for controlling a game character is shown. This method can be performed by the aforementioned electronic device. The method 900 may include one or more of the steps described below.

[0266] S901, Identify and display the safe zone.

[0267] S902, determine the user's initial position.

[0268] S903 detects whether the user's location is outside the safe zone.

[0269] S904a, determines whether the game character will switch tracks.

[0270] S904b, pause the game.

[0271] It should be understood that steps S901 to S904b are the same as S501 to S504b, and for details, please refer to S501 to S504b.

[0272] S905, determine whether the first distance is greater than the preset threshold corresponding to the target track.

[0273] Specifically, if it is detected in S904a that the game character will switch tracks, then the first distance is obtained and it is determined whether the first distance is greater than the preset threshold corresponding to the target track.

[0274] S906a, if the first distance is greater than the preset threshold corresponding to the target track, then measure one shall be executed.

[0275] S906b, if the first distance is less than or equal to the preset threshold corresponding to the target track, then execute measure two.

[0276] In the first example, the first measure is: if the user's current location is to the left of the user's initial location, switch the game character to the first area; if the user's current location is to the right of the user's initial location, switch the game character to the second area. For example, see [link to example]. Figure 18 The scenario diagram is shown. Accordingly, measure two is as follows: If the target track is not the initial track, and the user's current position is to the left of the user's initial position, the game character is switched to the second area or the middle position of the target track horizontally; if the user's current position is to the right of the user's initial position, the game character is switched to the first area or the middle position of the target track horizontally. If the target track is the initial track, the game character is switched to the middle position of the target track horizontally. For example, see... Figure 19 The scene diagram shown illustrates this. Both the first and second regions are located within the target track area, with the first region situated to the left of the target track and the second region to the right. For example, the first and second regions do not overlap.

[0277] In the second example, measure one is: based on measure one in the first example, a first facility is set up in the first and / or second area, which is used to slow down the game character. For example, see [link to example]. Figure 20 The scene diagram is shown. Accordingly, measure two is the same as measure two in the first example.

[0278] In the third example, measure one is: building upon measure one of the first example, setting the game track to have uneven edges to create a swaying effect for the game character in the first or second area. For example, see [link to example]. Figure 21 The scene diagram is shown. Accordingly, measure two is the same as measure two in the first example.

[0279] It should be understood that the first to third examples here can be found in method 800 described above.

[0280] Based on Method 900, the probability of personal safety incidents such as bumps and knocks during gameplay can be reduced, thereby improving the user's gaming experience.

[0281] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0282] When functional modules are divided according to their respective functions, the electronic device may include a processing unit, and may further include a display unit. The display unit and the processing unit cooperate to implement the technical processes described herein.

[0283] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0284] The electronic device provided in this embodiment is used to execute the above-described method for controlling game characters, and therefore can achieve the same effect as the above-described implementation method.

[0285] When using integrated units, the electronic device may include a processing module, a storage module, and a communication module. The processing module can be used to control and manage the actions of the electronic device; for example, it can support the electronic device in performing the steps described above. The storage module can support the electronic device in executing stored program code and data. The communication module can support communication between the electronic device and other devices.

[0286] The processing module can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.

[0287] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the method for controlling game characters described in the above embodiment.

[0288] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the method for controlling game characters described in the above embodiment.

[0289] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the methods for controlling game characters in the above-described method embodiments.

[0290] In this embodiment, the electronic device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0291] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0292] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0293] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0294] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0295] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0296] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for controlling a game character, characterized in that, include: Determine whether the game character corresponding to the user will switch to the initial track, wherein the game track is set to have uneven edges to cause the game character to have a shaking effect in the first or second area, and the game track includes the initial track; When the game character switches to the initial track, a first distance is obtained. The first distance is the horizontal distance between the user's current position and the user's initial position. When the user is at the initial position, the game character is located at the middle position of the initial track in the horizontal direction. If the first distance is greater than a preset threshold, and the user's current location is to the left of the initial location, the game character is switched to the first area to cause the game character to shake. If the user's current location is to the right of the initial location, the game character is switched to the second area to cause the game character to shake. Both the first area and the second area are located within the initial track, with the first area located to the left of the initial track and the second area located to the right of the initial track. If the first distance is less than or equal to the preset threshold, the game character is switched to the middle position of the initial track in the horizontal direction so that the game character does not sway.

2. The method as described in claim 1, characterized in that, If the first distance is greater than the preset threshold, the method further includes: The first track is set as an unavailable track, and a second track is generated. If the user's current position is to the left of the initial position, the first track is the leftmost track in the current game track, and the second track is the right adjacent track of the rightmost track in the current game track. If the user's current position is to the right of the initial position, the first track is the rightmost track in the current game track, and the second track is the left adjacent track of the leftmost track in the current game track.

3. The method as described in claim 1 or 2, characterized in that, The method further includes: The first area and / or the second area are provided with a first facility, which is used to slow down the game character.

4. The method as described in claim 1 or 2, characterized in that, The initial position is located within a safe zone, which is determined based on the user's environment.

5. The method as described in claim 1 or 2, characterized in that, When the number of game tracks is odd, the initial track is the middle track in the game; when the number of game tracks is even, the initial track is one of the two middle tracks in the game.

6. A method for controlling a game character, characterized in that, include: When the user's game character is about to switch to the initial track, switch the game character to the initial track; Obtain a first distance, which is the horizontal distance between the user's current location and the user's initial location. When the user is at the initial location, the game character is located at the middle position of the initial track in the horizontal direction. If the first distance is greater than a preset threshold, the first track is set as an unusable track by setting obstacles in the first track, and a second track is generated. If the user's current position is to the left of the initial position, the first track is the leftmost track in the current game track, and the second track is the right adjacent track of the rightmost track in the current game track. If the user's current position is to the right of the initial position, the first track is the rightmost track in the current game track, and the second track is the left adjacent track of the leftmost track in the current game track.

7. A method for controlling a game character, characterized in that, include: When the user's corresponding game character is about to switch to the initial track, a first distance is obtained. The first distance is the horizontal distance between the user's current position and the user's initial position. When the user is at the initial position, the game character is located at the middle position of the initial track in the horizontal direction. The game track is set to have uneven edges so that the game character will have a swaying effect in the first or second area. The game track includes the initial track. If the first distance is greater than a first preset threshold, and the user's current location is to the left of the initial location, the game character is switched to the first area to cause a swaying effect; if the user's current location is to the right of the initial location, the game character is switched to the second area to cause a swaying effect; if the first distance is less than or equal to the first preset threshold, the game character is switched to the middle of the initial track in the horizontal direction to prevent a swaying effect. Both the first and second areas are located within the initial track, with the first area to the left of the initial track and the second area to the right of the initial track. If the first distance is greater than the second preset threshold, the first track is set as an unavailable track and a second track is generated. If the user's current position is to the left of the initial position, the first track is the leftmost track in the current game track, and the second track is the right adjacent track of the rightmost track in the current game track. If the user's current position is to the right of the initial position, the first track is the rightmost track in the current game track, and the second track is the left adjacent track of the leftmost track in the current game track. The first preset threshold is less than the second preset threshold.

8. The method as described in claim 7, characterized in that, The method further includes: The first area and / or the second area are provided with a first facility, which is used to slow down the game character.

9. The method as described in claim 7 or 8, characterized in that, The initial position is located within a safe zone, which is determined based on the user's environment.

10. A method for controlling a game character, characterized in that, include: Determine whether the game character corresponding to the user will switch game tracks, wherein the game track is set to have uneven edges so that the game character will have a shaking effect in the first or second area; When the game character switches game tracks, a first distance is obtained. The first distance is the horizontal distance between the user's current position and the user's initial position. When the user is at the initial position, the game character is located at the middle position of the initial track in the horizontal direction, so that the game character does not produce a shaking effect. The game track includes the initial track. If the first distance is greater than a preset threshold corresponding to the target track, and the user's current position is to the left of the initial position, the game character is switched to the first area to cause a shaking effect; if the user's current position is to the right of the initial position, the game character is switched to the second area to cause a shaking effect. If the first distance is less than or equal to the preset threshold, and the target track is not the initial track, then if the user's current location is to the left of the initial location, the game character is switched to the second area or the middle position of the target track in the horizontal direction; if the user's current location is to the right of the initial location, the game character is switched to the first area or the middle position of the target track in the horizontal direction. If the first distance is less than or equal to the preset threshold, and the target track is the initial track, the game character is switched to the middle position of the target track in the horizontal direction. Both the first area and the second area are located within the target track, with the first area located on the left side of the target track and the second area located on the right side of the target track.

11. The method as described in claim 10, characterized in that, The method further includes: The first area and / or the second area are provided with a first facility, which is used to slow down the game character.

12. The method as described in claim 10 or 11, characterized in that, The initial position is located within a safe zone, which is determined based on the user's environment.

13. The method as described in claim 10 or 11, characterized in that, When the number of game tracks is odd, the initial track is the middle track in the game; when the number of game tracks is even, the initial track is one of the two middle tracks in the game.

14. An electronic device, characterized in that, Includes units or modules for performing the method as described in any one of claims 1-13.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-13.

16. An electronic device, characterized in that, The device includes a processor coupled to a memory for storing programs or instructions that, when executed by the processor, cause the electronic device to perform the method as described in any one of claims 1-13.

17. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-13.

Citation Information

Patent Citations

  • Prompt processing method and device, storage medium and electronic device

    CN108905205A