A method, device, storage medium and electronic device for rendering a game interface
By collecting sensor data on mobile devices, calculating and rendering the motion trajectory of thrown objects, the problem of difficulty in finding suitable water surfaces in cities or densely populated areas is solved, and the function of playing games in any occasion is realized, which improves the User experience.
Patent Information
- Application Number
- CN202410427351.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-04-09
AI Technical Summary
In cities or densely populated areas, it is difficult to find the right water surface to play water rafting games, which limits the user's gaming experience.
By setting up sensors on mobile devices, collect sensor data when the user simulates the throwing object, calculate the throwing data and motion trajectory, and render the motion trajectory of the throwing object in the client's game interface.
It realizes the function of users to play games in any occasion, breaks through the limitations of the actual environment, and significantly increases the user's gaming experience.
Smart Images

Figure CN118179020B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for rendering a game interface. Background Art
[0002] Water skipping is an outdoor game in which a stone is allowed to jump as many times as possible on the water surface, and the winner is determined by comparing the number of times the stone jumps.
[0003] Since the game of skipping stones on water usually requires a relatively flat water surface of a certain length, such as a lake, a river, or a beach, it is relatively difficult to find a suitable location in cities or densely populated areas, and the game of skipping stones on water cannot be played at any time. Summary of the invention
[0004] The embodiments of this specification provide a method, device, storage medium and electronic device for rendering a game interface to partially solve the problems existing in the above-mentioned prior art.
[0005] The embodiments of this specification adopt the following technical solutions:
[0006] This specification provides a method for rendering a game interface, including:
[0007] Acquiring sensor data, where the sensor data is collected by a sensor disposed on the mobile device when the user swings the mobile device in a manner that simulates swinging a thrown object;
[0008] Determine, based on the sensor data, throwing data generated when the user swings the mobile device to simulate swinging a thrown object to perform simulated skipping, wherein the throwing data includes a speed at which the user swings the mobile device, and an inclination angle between a direction in which the mobile device is swung and a default horizontal plane;
[0009] Determining, based on the throwing data, a movement trajectory of the thrown object on the water surface when the user simulates skipping stones;
[0010] The motion trajectory is rendered in a preset game interface of the client.
[0011] Optionally, before the step of determining, based on the sensor data, the throwing data generated when the user swings the mobile device in a manner of simulating the swinging of a throwing object to simulate skipping stones, the method further comprises:
[0012] filtering the sensor data to obtain filtered sensor data;
[0013] The step of determining, based on the sensor data, the throwing data generated when the user swings the mobile device in a manner of simulating the swinging of a throwing object to simulate skipping stones on water specifically includes:
[0014] The throwing data generated when the user simulates the throwing of a thrown object by swinging the mobile device to simulate skipping stones is determined according to the filtered sensor data.
[0015] Optionally, the step of determining, based on the throwing data, a movement trajectory of the thrown object on the water surface when the user simulates skipping stones, specifically includes:
[0016] In the process of the user simulating the water skipping, the motion data of the thrown object when it flies out of each water skip formed by hitting the water surface is determined according to the throwing data;
[0017] The motion trajectory of the thrown object on the water surface when the user simulates skipping stones is determined based on the motion data.
[0018] Optionally, the step of determining, based on the throwing data, motion data of the thrown object when it flies out of each water float formed by hitting the water surface specifically includes:
[0019] For each water float formed by the projectile hitting the water surface, determining the initial motion data of the projectile when hitting the water surface to form the water float according to the projectile data;
[0020] The motion data of the projectile when it flies out of the water float is determined based on the initial motion data and the buoyancy and sliding friction received by the projectile when it hits the water surface to form the water float.
[0021] Optionally, the step of determining, based on the motion data, a motion trajectory of the thrown object on the water surface when the user simulates skipping stones, specifically includes:
[0022] For each water float formed by the projectile hitting the water surface, according to the motion data of the projectile when it flies out of the water float, determine the trajectory formed by the projectile flying to the next water float as the motion trajectory formed by the projectile after passing through the water float;
[0023] According to the motion track formed by the projectile after passing through each water skip, the motion track of the projectile on the water surface when the user performs simulated water skipping is determined.
[0024] Optionally, the throwing data further includes: angular momentum of the mobile device when the user throws the mobile device.
[0025] Optionally, the method further comprises:
[0026] The score obtained by the user when skipping stones in the client is determined according to the number of water skips formed by the projectile hitting the water surface, and the score is displayed in a preset game interface of the client.
[0027] This specification provides a game interface rendering device, which is applied to a client installed in a mobile device, including:
[0028] An acquisition module, used to acquire sensor data, wherein the sensor data is collected by a sensor disposed on the mobile device when the user swings the mobile device in a manner simulating the swinging of a thrown object;
[0029] A first determination module is used to determine, based on the sensor data, throwing data generated when the user swings the mobile device to simulate swinging a thrown object to perform simulated skipping, wherein the throwing data includes a speed at which the user swings the mobile device, and an inclination angle between a direction in which the mobile device is swung and a default horizontal plane;
[0030] A second determination module is used to determine, based on the throwing data, a movement trajectory of the thrown object on the water surface when the user simulates skipping stones;
[0031] A rendering module is used to render the motion trajectory in a preset game interface of the client.
[0032] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned method for rendering a game interface is implemented.
[0033] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for rendering a game interface when executing the program.
[0034] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:
[0035] In an embodiment of the present specification, when a user simulates swinging a projectile by swinging a mobile device, sensor data is collected by a sensor arranged on the mobile device, and based on the obtained sensor data, throwing data generated when the user simulates swinging a projectile by swinging the mobile device to simulate skipping stones is determined. Furthermore, based on the obtained throwing data, the movement trajectory of the projectile on the water surface when the user simulates skipping stones is determined, and the movement trajectory of the projectile is rendered in a preset game interface of a client installed in the mobile device, wherein the throwing data includes the speed at which the user swings the mobile device, and the inclination angle between the direction in which the mobile device is swung and a default horizontal plane.
[0036] In this method, sensors built into a mobile device are used to collect sensor data when a user swings the mobile device to simulate swinging a projectile to simulate skipping stones on water. Then, the throwing data determined based on the sensor data is used to further obtain the motion trajectory of the projectile skipping stones on water. As a result, the process of the user simulating the skipping stone game is presented in a preset game interface of the client. In this way, the user can play the skipping stone game in any occasion, thereby significantly improving the user's gaming experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0038] Figure 1 A flowchart of a method for rendering a game interface provided in an embodiment of this specification;
[0039] Figure 2 A schematic diagram of the forces acting on a projectile when it flies out of the water in a method for rendering a game interface provided in an embodiment of this specification;
[0040] Figure 3 A schematic diagram of the motion trajectory of a projectile in a preset game interface in a method for rendering a game interface provided in an embodiment of this specification;
[0041] Figure 4 A schematic diagram of the scores of a client-side skipping stone game in a method for rendering a game interface provided in an embodiment of this specification;
[0042] Figure 5 A schematic diagram of the structure of a game interface rendering device provided in an embodiment of this specification;
[0043] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0045] The skipping stone game is an outdoor game played near a body of water, such as a river or lake. Thin stones or tiles are used as projectiles. The projectiles are thrown in a specific way to make them bounce on the water. The outcome of the game is determined by the number of skipping stones that occur during the process.
[0046] However, since the game of skipping stones on water has certain requirements for the game location and environmental conditions, there are some limitations in the actual game of skipping stones on water. For example, the game location needs to be near water bodies such as rivers or lakes, which means that not all water bodies are suitable for skipping stones on water, especially in areas lacking natural water bodies, or when the wind is strong or the water surface is not calm, it is difficult to play the game of skipping stones on water.
[0047] In order to solve the above problem, in an embodiment of the present specification, a sensor is set on a mobile device to collect sensor data when a user simulates swinging a projectile by swinging the mobile device, and based on the obtained sensor data, the throwing data generated when the user simulates swinging a projectile by swinging the mobile device to simulate skipping stones is determined, and then, based on the obtained throwing data, the movement trajectory of the projectile on the water surface when the user simulates skipping stones is determined, and the movement trajectory of the projectile is rendered in a preset game interface of a client installed in the mobile device, wherein the throwing data includes the speed at which the user swings the mobile device, and the inclination angle between the direction of swinging the mobile device and a default horizontal plane.
[0048] In this method, sensor data collected by a sensor installed on a mobile device when a user swings the mobile device to simulate swinging a projectile to simulate skipping stones is used to determine the throwing data, and based on the throwing data, the movement trajectory of the projectile on the water surface when the user simulates skipping stones is determined. Subsequently, the game process of the user simulating skipping stones is presented in a preset game interface of the client, thereby achieving the purpose of allowing users to play the skipping stone game on mobile devices at any time, providing users with convenient services, and further enhancing users' gaming experience.
[0049] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0050] Figure 1 A flowchart of a method for rendering a game interface provided in an embodiment of this specification includes:
[0051] S100: Acquire sensor data, where the sensor data is collected by a sensor disposed on the mobile device when the user swings the mobile device in a manner of simulating the swinging of a thrown object.
[0052] For a method of rendering a game interface provided in this specification, a mobile device such as a smart phone or a client in the mobile device can be used as an execution subject. For the sake of ease of description, the following describes a method of rendering a game interface provided in this specification with the client as the execution subject.
[0053] Next, the client obtains sensor data through the sensor set on the mobile device, and the sensor data is generated in the process of the user simulating the swinging of the thrown object by swinging the mobile device.
[0054] Specifically, the user opens the client for the skipping stone game in the mobile device, and simulates swinging the mobile device to simulate the swinging of the projectile in the preset game interface. During the swinging process, the client collects sensor data of the mobile device during the swinging process through the sensor set on the mobile device, and then analyzes the collected sensor data to obtain the motion trajectory of the projectile, and renders the motion trajectory of the projectile in the preset game interface to show it to the user.
[0055] When the user uses the client to play the water skipping game for the first time, a prompt may be displayed to the user in a preset game interface to guide the user to perform the water skipping operation. Mobile phone.
[0056] It should be noted that the sensors mentioned here that are set on the mobile device can be a gyroscope sensor and a gravity sensor. When the user simulates swinging the mobile device to simulate throwing objects, the angular velocity of the mobile device on each coordinate axis on the default three-dimensional coordinate axis, that is, the angular velocity corresponding to the X-axis, Y-axis and Z-axis, is collected through the gyroscope sensor. When the user simulates swinging the mobile device to simulate throwing objects, the acceleration of the mobile device on each coordinate axis on the default three-dimensional coordinate axis, that is, the acceleration corresponding to the X-axis, Y-axis and Z-axis, is collected through the gyroscope sensor.
[0057] Among them, the mobile device mentioned here can be using the Android system or the Apple system. If it is the Android system, the sensor manager in the Android system (such as the SensorManager class) can be called through the Android mobile device to obtain the gravity sensor and gyroscope data, and the acceleration and angular velocity of the x, y, and z axes can be monitored by calling the sensor data change method (such as the onSensorChanged method).
[0058] If it is an Apple system, a mobile device using the Apple system can obtain the gravity sensor and gyroscope data through the CoreMotion framework on the Apple system, obtain the acceleration of the x, y, and z axes in the accelerometerHandler method, and obtain the angular velocity of the x, y, and z axes in the startGyroUpdates method.
[0059] Among them, in the Android system, the SensorManager class is a class provided by the Android system for accessing mobile device sensors. It is used to register listeners to receive sensor data changes and perform other sensor-related operations. The onSensorChanged method is a callback method that can be called to obtain new sensor data.
[0060] In Apple systems, the CoreMotion framework is used to process data related to device motion, including sensor data. The startGyroUpdates method is used to process acceleration data. The startGyroUpdates method is used to start and manage the acquisition of gyroscope data.
[0061] By combining the gyroscope sensor and the gravity sensor, the movement and posture of the mobile device when the user swings the mobile device to simulate the swinging of the throwing object can be more accurately sensed, thereby determining a more accurate movement trajectory of the throwing object on the water surface when the user simulates skipping stones, thereby enhancing the user's experience of playing the skipping stone game on the mobile device.
[0062] S102: Determine, based on the sensor data, throwing data generated when the user swings the mobile device to simulate swinging a projectile to simulate skipping stones, wherein the throwing data includes the speed at which the user swings the mobile device, and the inclination angle between the direction in which the mobile device is swung and a default horizontal plane.
[0063] The process of a projectile hitting a horizontal plane to form each water float can be regarded as two parts, namely, the projectile first hits the water surface at a certain speed and angle, and then flies out of the water surface at a certain speed and angle, thus forming a water float.
[0064] Therefore, the main reasons why a thrown object can cause skips on the water surface can be summarized into two: one is the initial velocity of the thrown object. Generally speaking, the greater the initial velocity, the more skips there are; the second is the inclination angle between the thrown object and the default horizontal plane when it is thrown. Generally speaking, the smaller the inclination angle, the closer the thrown object is to the default horizontal plane, and the longer the total distance the thrown object skips.
[0065] It can be seen that in order to accurately determine the motion trajectory of the projectile in the preset game interface, it is necessary to obtain the speed at which the projectile is thrown and the inclination angle between the projectile and the default horizontal plane when it is thrown out.
[0066] Therefore, after obtaining the sensor data on the mobile device through the above steps, the client will determine the throwing data generated when the user simulates skipping stones by swinging the mobile device to simulate skipping stones, so that the client can obtain the motion trajectory of the object generated by the user when simulating skipping stones based on the throwing data.
[0067] Among them, the throwing data includes the speed at which the user swings the mobile device, and the inclination angle between the direction in which the user swings the mobile device and the default horizontal plane. The client can determine the initial motion posture of the thrown object in the skipping stone game based on the speed and the inclination angle, that is, the inclination angle between the thrown object and the default horizontal plane and the initial speed of the thrown object when the thrown object is thrown.
[0068] Furthermore, based on the initial velocity of the projectile, the first water float formed by the projectile hitting the water surface and the speed of the projectile flying out from the first water float can be determined, and the motion trajectory of the projectile between the first water float and the second water float can be determined based on the speed of the projectile flying out from the first water float and the inclination angle with the horizontal plane, and the speed of the projectile flying out from the second water float formed by hitting the water surface can be further determined, and so on, the motion trajectory between each two adjacent water floats formed by the projectile in the process of skipping water can be obtained, thereby obtaining the complete motion trajectory formed by the projectile in the process of skipping water. The specific process will be explained in subsequent steps and will not be repeated here.
[0069] In addition, since the user may rotate when swinging the mobile device to simulate the swinging of the projectile, the angular momentum generated by the rotation will affect the initial speed of the projectile, and further affect the number of water skips. In other words, when the inclination angle between the projectile and the default horizontal plane remains unchanged, the greater the angular momentum, the greater the initial speed of the projectile when it is thrown out, the more water skips are formed in the process, and the higher the score.
[0070] Therefore, the throwing data may also include the angular momentum generated when the mobile device is rotated when the user throws the mobile device.
[0071] Furthermore, in order to more realistically simulate the process of a projectile skipping on water and provide users with a more realistic experience, in addition to determining the initial velocity of the projectile when it is thrown out and the inclination angle between the projectile and the default horizontal plane, it is also necessary to determine the angular momentum generated when the projectile rotates.
[0072] That is to say, in fact, when determining the motion trajectory of the projectile, it can be determined based on the initial velocity of the projectile, the inclination angle between the projectile and the default horizontal plane, and the angular momentum.
[0073] In an embodiment of the present specification, before obtaining the throwing data, the client will filter the collected sensor data to obtain filtered sensor data, so as to remove noise in the sensor data and reduce the impact of interference noise, thereby obtaining more accurate and reliable sensor data. Then, the client can use the filtered sensor data to determine the throwing data generated when the user simulates swinging a throwing object to simulate skipping stones by swinging a mobile device.
[0074] The filtering of the collected sensor data mentioned here may be performed using conventional methods such as a Kalman filter to remove noise points in the sensor data, and this specification does not limit the specific filtering method.
[0075] The throwing data obtained above is used to further determine the movement trajectory of the thrown object on the water surface when the user simulates skipping stones.
[0076] S104: Determine, based on the throwing data, a movement trajectory of the thrown object on the water surface when the user simulates skipping stones.
[0077] In the embodiment of the present specification, after obtaining the throwing data, the client analyzes the throwing data to determine the movement trajectory of the thrown object on the water surface when the user simulates skipping stones.
[0078] Specifically, in an embodiment of the present specification, after the user simulates skipping stones, the client determines the motion data of the projectile when it flies out of each water float formed by hitting the water surface based on the throwing data corresponding to the projectile, and then, based on the motion data, further determines the motion trajectory of the projectile on the water surface when the user simulates skipping stones.
[0079] To elaborate, for each water float formed by the projectile hitting the water surface, the initial motion data of the projectile when hitting the water surface to form the water float is determined based on the obtained throwing data. Then, based on the initial motion data, as well as the buoyancy and sliding friction received by the projectile when hitting the water surface to form the water float, the motion data of the projectile when it flies out of the water float is determined.
[0080] The motion data of the projectile flying out of the water float is used as the initial motion data when the projectile hits the water surface to form the next water float, and the motion data of the projectile flying out of the next water float is determined according to the initial motion data of the next water float and the buoyancy and sliding friction received by the projectile when it hits the water surface to form the water float. The motion data refers to the components of the velocity of the projectile on the default horizontal and vertical coordinates when it flies out of each water float, which can be specifically expressed by the following formula:
[0081] Taking the i-th water float as an example, the initial motion data of the i+1-th water float are calculated according to equations (1) and (2) (i=1, 2, 3, ..., I-1, I, I is the total number of water floats):
[0082]
[0083]
[0084] Among them, m s is the mass of the projectile, ρ ω is the density of water, g is the gravitational constant of 9.8 N / Kg, α i is the angle between the object and the default horizontal plane when the object of the i-th water skip hits the water surface, V i,a is the speed of the projectile hitting the water surface, A i,m is the immersion area of the projectile after it hits the water surface, C l is the lift coefficient, C f is the friction coefficient. The lift coefficient and friction coefficient are constants and can be approximated to 1. V i,x is the velocity component of the projectile flying out of the ith water float on the default horizontal axis, V i,y It is the component speed of the projectile flying out of the i-th water float on the default vertical axis.
[0085] In order to further illustrate the principle of the above formula, the following diagram of a projectile hitting the water surface will be used to explain the force process of the projectile. Figure 2 shown.
[0086] Figure 2 A schematic diagram of the forces acting on a projectile when it flies out of water in a method for rendering a game interface provided in an embodiment of this specification.
[0087] by Figure 2Taking the force diagram of the projectile in as an example, when the projectile flies out of the water, it is affected by the gravity of the projectile itself, the buoyancy of the water surface on the projectile, the sliding friction when the projectile flies out of the water, and the throwing force of the projectile when the user initially simulates swinging the projectile to simulate skipping stones. These serve as the initial driving force for the projectile to skip stones, and gravity, buoyancy and friction can all be regarded as resistance.
[0088] First, determine the components of the force on the X-axis and Y-axis of the projectile respectively. Then, according to Newton's third law, solve the component of the resistance on the X-axis, that is, the right side of the equation (1). The resistance is the total external force on the projectile in the i-th water float, which is equivalent to the component of the total external force on the projectile on the X-axis. According to Newton's second law, it can be known that the component of the total external force on the X-axis can be expressed by the product of the component of the acceleration on the X-axis and the mass of the projectile.
[0089] Similarly, the motion formula on the Y-axis is determined based on Newton's third law and Newton's second law, that is, the above formula (2).
[0090] Among them, Newton's second law is that the acceleration of an object is proportional to the resultant external force it receives and inversely proportional to the mass of the object. The direction of the acceleration is the same as the direction of the resultant external force. The resultant external force received by the projectile can be obtained based on the product of the acceleration of the projectile and the mass of the projectile. Newton's third law is that the action and reaction forces between two objects are equal in magnitude and opposite in direction on the same straight line. It can be seen that the components of force on the same coordinate axis are equal in magnitude but opposite in direction.
[0091] Furthermore, according to the relationship between the obtained acceleration and velocity, that is, the acceleration describes the rate of change of velocity, the acceleration of the X-axis and Y-axis determined by formula (1) and formula (2) can be used to obtain the speed and direction of the projectile flying out of the i-th water float, that is, The component of acceleration on the X-axis is expressed by the differential of the component of velocity on the X-axis. The component of acceleration on the Y axis is expressed as the differential of the component of velocity on the Y axis.
[0092] Furthermore, the client determines the trajectory of the projectile flying to the next water float based on the motion data of the projectile when it flies out of the water float, and uses it as the motion trajectory of the projectile after passing through the water float. Then, based on the motion trajectory of the projectile after passing through each water float, the motion trajectory of the projectile on the water surface when the user simulates skipping water is determined.
[0093] The client simulates the motion trajectory of the thrown object on the water surface when skipping stones. Figure 3 is displayed to the user in the form of
[0094] Figure 3 A schematic diagram of the movement trajectory of a projectile in a preset game interface in a method for rendering a game interface provided in an embodiment of this specification.
[0095] exist Figure 3 As can be seen in the figure, after the user starts the client, the preset game interface of the client will show a river. When the user swings the mobile device in a certain direction to simulate the throwing of the thrown object in the preset game interface, the motion trajectory formed by the thrown object will be in Figure 3 The interface shown shows that Figure 3 The arrow in the figure indicates the direction in which the thrown object skips on the water in the preset game interface.
[0096] Since there is no force between the projectile and the water surface when the projectile flies out of the water float, and ideally it is only subjected to the vertical downward gravity, the trajectory of the projectile flying from the water float to the next water float is obtained based on the motion data of the projectile when it flies out of the water float and the vertical downward gravity exerted on the projectile, combined with the motion trajectories in the horizontal and vertical directions. Furthermore, based on the motion trajectory between each two adjacent water floats, the overall motion trajectory of the projectile on the water surface when the user simulates skipping water is determined.
[0097] S106: Rendering the motion trajectory in a preset game interface of the client.
[0098] The motion trajectory of the projectile in the water skipping game is determined by the above method, so that the client renders the motion trajectory of the projectile in the preset game interface, so that the user can observe the water skipping motion of the projectile more intuitively in the mobile device.
[0099] Specifically, after obtaining the motion trajectory of the projectile in the process of skipping stones and the throwing data of the projectile through the above steps, the motion trajectory of the projectile, the throwing data of the projectile, the water surface, the projectile, the number of skips, and the material of the water surface and the stone are imported into a preset game engine as game resources. According to the scenes to be presented in the game interface and the imported game resources, scene objects are created. In order to control the behavior logic of the scene objects, that is, the way in which the scene objects can change their behavior according to the user's operation, the preset game engine can be used to write corresponding scripts for the scene objects whose behavior needs to change with the user's operation, so as to achieve complex interaction and simulation effects.
[0100] The preset game engine may be Unity 3D engine or Unreal Engine (UE).
[0101] After completing the scene and script settings, select the mobile device you want to use, and then install the compiled game into the mobile device as a client in the mobile device.
[0102] It should be noted that scene objects refer to the visual or interactive elements that actually appear in the game interface, that is, the objects that users can see in the game interface. For example, scene objects can be things such as projectiles and water surfaces that appear in the game interface.
[0103] In addition, after the user completes the skipping stone game through the client installed in the mobile device, the score obtained by the user when playing the skipping stone game in the client installed in the mobile device is determined according to the number of skips formed by the thrown objects hitting the water surface during the process, and the score is displayed in the preset game interface of the client, that is, the more skips there are, the higher the score.
[0104] Of course, the client can also comprehensively determine the score of skipping water according to the number of skipping water and the total distance of the thrown object skipping water, that is, the more skipping water there are, the higher the score, and the longer the total distance of the thrown object skipping water, the higher the score.
[0105] In the client you can Figure 4 In the form of , the score obtained in this water skipping game is shown to the user.
[0106] Figure 4 A schematic diagram of the scores of a client-side skipping stone game in a method for rendering a game interface provided in an embodiment of this specification.
[0107] exist Figure 4 It can be seen that after the user simulates the skipping stone game in the client, the client will display a pop-up window in the preset game interface, and display the score obtained by the user in this skipping stone game in the window.
[0108] In addition, the client can determine, based on the positioning information, what kind of background to use to display the movement trajectory of the thrown objects when the user simulates the skipping stone game in the client. For example, when the client determines, based on the positioning information of the mobile device, that the user starts the skipping stone game in a city, the movement trajectory of the thrown objects is displayed with the lake or river and the surrounding environment as the background. For another example, when the client determines, based on the positioning information of the mobile device, that the user starts the skipping stone game in a coastal city, the movement trajectory of the thrown objects is displayed with the environment around the ocean and the beach as the background.
[0109] Furthermore, the client may also determine the display form of the thrown objects based on the positioning information. For example, if the client determines based on the positioning information of the mobile device that the user is playing the skipping stone game on the riverside, the thrown objects may be smooth pebbles. For another example, if the client determines based on the positioning information of the mobile device that the user is playing the skipping stone game in a coastal city, the thrown objects may be flat shells.
[0110] It can be seen from the above method that the client determines the throwing data by collecting sensor data when the user swings the mobile device to simulate skipping stones, and based on the throwing data, determines the movement trajectory of the object on the water surface when the user simulates skipping stones. Then, the movement trajectory is rendered in the preset game interface, thereby presenting the process of skipping stones on the client, achieving the purpose of allowing users to play the skipping stone game on mobile devices at any time, breaking through the limitations of playing the skipping stone game in reality, and further meeting user needs.
[0111] In addition, the client removes noise from the sensor data by filtering the collected sensor data to ensure that the motion trajectory of the projectile obtained based on the sensor data is more reasonable. In order to make the motion trajectory of the projectile more in line with the actual motion laws, the angular velocity of the projectile, the inclination angle between the default horizontal plane and the angular momentum are referred to to obtain a more accurate motion trajectory, increase the realism of the game, and improve the user gaming experience.
[0112] The above is a method for rendering a game interface provided in an embodiment of this specification. Based on the same idea, this specification also provides corresponding devices, storage media and electronic devices.
[0113] Figure 5 A schematic diagram of the structure of a game interface rendering device provided in an embodiment of this specification, the device comprising:
[0114] An acquisition module 501 is used to acquire sensor data, where the sensor data is collected by a sensor disposed on the mobile device when the user swings the mobile device in a manner of simulating the swinging of a thrown object;
[0115] A first determining module 502 is used to determine, based on the sensor data, throwing data generated when the user swings the mobile device to simulate swinging a thrown object to perform simulated skipping, wherein the throwing data includes a speed at which the user swings the mobile device, and an inclination angle between a direction in which the mobile device is swung and a default horizontal plane;
[0116] The second determination module 503 is used to determine the movement trajectory of the thrown object on the water surface when the user simulates skipping stones according to the throwing data;
[0117] The rendering module 504 is used to render the motion trajectory in the preset game interface of the client.
[0118] Optionally, before determining, based on the sensor data, the throwing data generated when the user simulates the throwing of a thrown object by swinging the mobile device to simulate skipping stones, the first determining module 502 is further configured to filter the sensor data to obtain filtered sensor data;
[0119] The first determination module 502 is specifically configured to determine, based on the filtered sensor data, the throwing data generated when the user simulates the throwing of a thrown object by swinging the mobile device to perform simulated skipping.
[0120] Optionally, the second determination module 503 is specifically used to determine, based on the throwing data, the motion data of the projectile when it flies out from each water float formed by hitting the water surface during the user's simulated skipping stone process; and to determine, based on the motion data, the motion trajectory of the projectile on the water surface when the user simulates skipping stone.
[0121] Optionally, the second determination module 503 is specifically used to determine, for each water float formed by the projectile hitting the water surface, based on the throwing data, the initial motion data of the projectile when it hits the water surface to form the water float; and to determine the motion data of the projectile when it flies out of the water float based on the initial motion data and the buoyancy and sliding friction received by the projectile when it hits the water surface to form the water float.
[0122] Optionally, the second determination module 503 is specifically used to determine, for each water skip formed by the projectile hitting the water surface, based on the motion data of the projectile when it flies out of the water skip, the trajectory formed by the projectile flying to the next water skip as the motion trajectory formed by the projectile after passing through the water skip; based on the motion trajectory formed by the projectile after passing through each water skip, determine the motion trajectory of the projectile on the water surface when the user simulates skipping water.
[0123] Optionally, the throwing data further includes: angular momentum of the mobile device when the user throws the mobile device.
[0124] Optionally, the device further comprises a scoring module 505;
[0125] The scoring module 505 is specifically used to determine the score obtained by the user when skipping stones in the client according to the number of water skips formed by the projectile hitting the water surface, and display the score in a preset game interface of the client.
[0126] This specification also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, it can be used to perform the above Figure 1 A method for rendering a game interface is provided.
[0127] based on Figure 1 A method for rendering a game interface is shown, and the embodiment of this specification also provides Figure 6 The structural diagram of the electronic device shown in FIG. Figure 6 At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 A method for rendering a game interface.
[0128] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0129] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0130] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0131] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0132] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0133] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0134] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0135] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0137] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0138] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0139] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0140] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0141] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0142] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0143] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0144] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A method for rendering a game interface, characterized in that: The method is applied to a client installed in a mobile device, and includes: Acquiring sensor data, where the sensor data is collected by a sensor disposed on the mobile device when the user swings the mobile device in a manner that simulates swinging a thrown object; Calculating, based on the sensor data, throwing data generated when the user swings the mobile device in a manner of simulating swinging a thrown object to perform simulated skipping stones, the throwing data including the speed at which the user swings the mobile device, and an inclination angle between a direction in which the mobile device is swung and a default horizontal plane; During the process of the user simulating skipping, the motion data of the projectile when it flies out of each water skip formed by hitting the water surface is calculated according to the throwing data; and the motion trajectory of the projectile on the water surface when the user simulates skipping is determined according to the motion data; The motion trajectory is rendered in a preset game interface of the client.
2. The method according to claim 1, characterized in that Before the step of determining, based on the sensor data, the throwing data generated when the user swings the mobile device in a manner of simulating the swinging of a throwing object to simulate skipping stones, the method further includes: filtering the sensor data to obtain filtered sensor data; The step of calculating, based on the sensor data, the throwing data generated when the user simulates the throwing of a thrown object by swinging the mobile device to simulate skipping stones, specifically comprises: The throwing data generated when the user simulates the throwing of a throwing object by swinging the mobile device to simulate skipping stones is calculated according to the filtered sensor data.
3. The method according to claim 1, characterized in that The step of calculating the motion data of each water float formed by the projectile hitting the water surface according to the projectile data specifically comprises: For each water float formed by the projectile hitting the water surface, calculating the initial motion data of the projectile when the projectile hits the water surface to form the water float according to the projectile data; The motion data of the projectile when it flies out of the water float is calculated based on the initial motion data and the buoyancy and sliding friction received by the projectile when it hits the water surface to form the water float.
4. The method according to claim 1, characterized in that The step of determining, based on the motion data, the motion trajectory of the thrown object on the water surface when the user simulates skipping stones, specifically comprises: For each water float formed by the projectile hitting the water surface, according to the motion data of the projectile when it flies out of the water float, determine the trajectory formed by the projectile flying to the next water float as the motion trajectory formed by the projectile after passing through the water float; According to the motion track formed by the projectile after passing through each water skip, the motion track of the projectile on the water surface when the user performs simulated water skipping is determined.
5. The method according to claim 1, characterized in that The throwing data further includes: the angular momentum of the mobile device when the user throws the mobile device.
6. The method according to claim 1, characterized in that The method further comprises: The score obtained by the user when skipping stones in the client is determined according to the number of water skips formed by the projectile hitting the water surface, and the score is displayed in a preset game interface of the client.
7. A game interface rendering device, characterized in that: The device is applied to a client installed in a mobile device, and includes: An acquisition module, used to acquire sensor data, wherein the sensor data is collected by a sensor disposed on the mobile device when the user swings the mobile device in a manner simulating the swinging of a thrown object; A first determination module is used to calculate, based on the sensor data, throwing data generated when the user simulates swinging a thrown object by swinging the mobile device to simulate skipping stones, wherein the throwing data includes a speed at which the user swings the mobile device, and an inclination angle between a direction in which the mobile device is swung and a default horizontal plane; The second determination module is used to calculate the motion data of the projectile when it flies out of each water skip formed by hitting the water surface according to the throwing data during the process of the user simulating the water skipping; and determine the motion trajectory of the projectile on the water surface when the user simulates the water skipping according to the motion data; A rendering module is used to render the motion trajectory in a preset game interface of the client.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Desktop dynamic icon implementing method, terminal and computer-readable medium
CN109271073A
Motion sensing game method based on throwing action
CN116251343A