Method and related device for element interaction in user interface

文档序号:1620771 发布日期:2020-01-14 浏览:21次 中文

阅读说明:本技术 一种用户界面中元素交互的方法以及相关装置 (Method and related device for element interaction in user interface ) 是由 梁超 刘智洪 于 2019-10-12 设计创作,主要内容包括:本申请公开了一种用户界面中元素交互的方法以及相关装置,通过获取目标元素的碰撞盒子,然后根据用户元素产生的射线触发射线检测,以确定交互参数;再根据所述交互参数确定所述目标元素的变化情况;接下来若所述目标元素的变化情况满足预设条件,则触发爆炸检测并确定爆炸范围,以进行所述目标元素与所述爆炸范围内其他元素的交互。由于将目标元素融入了用户元素的交互场景中,使得用户界面中的元素更加丰富,且提高了资源的利用率,达到了提升用户体验的效果。(The application discloses a method and a related device for element interaction in a user interface, wherein interaction parameters are determined by acquiring a collision box of a target element and triggering ray detection according to rays generated by the user element; determining the change condition of the target element according to the interaction parameters; and then triggering explosion detection and determining an explosion range if the change condition of the target element meets a preset condition so as to interact the target element with other elements in the explosion range. Because the target elements are merged into the interactive scene of the user elements, the elements in the user interface are richer, the utilization rate of resources is improved, and the effect of improving the user experience is achieved.)

1. A method for element interaction in a user interface, comprising:

acquiring a collision box of a target element, wherein the collision box is determined based on a model display mode of the target element in the user interface;

triggering ray detection according to rays generated by a user element to determine an interaction parameter, wherein the user element is used for indicating operation information of a user, and the interaction parameter is used for indicating the interaction degree of the operation information and a collision box of the target element;

determining the change condition of the target element according to the interaction parameter, wherein the change condition comprises the missing of the element in the target element, the addition of a specified element or the deformation of the element;

and if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range so as to carry out interaction between the target element and other elements in the explosion range, and determining that a corresponding special effect is displayed in the user interface.

2. The method of claim 1, wherein the acquiring the collision box of the target element comprises:

acquiring a ray range generated by the user element, wherein the ray range is set based on ray parameters of the user element, and the ray parameters are used for indicating state information of a user in the user interface;

and if the target element is within the ray range, acquiring a collision box of the target element.

3. The method of claim 1, wherein the determining the change condition of the target element according to the interaction parameter comprises:

if the interaction parameter is larger than a first threshold value, adding a first special effect to the target element;

triggering parameter statistics of a second special effect according to the first special effect to obtain a second special effect parameter;

if the second special effect parameter is larger than a second threshold value, the target element is updated, and the updated target element comprises a second special effect.

4. The method of claim 3, wherein triggering parameter statistics of the second effect according to the first effect to obtain second effect parameters comprises:

triggering calculation of a tapering function according to the first special effect, the tapering function being used to indicate a change in a pixel value of the first special effect;

and if the user element stops generating the ray, stopping the calculation of the gradient function to obtain a second special effect parameter.

5. The method of claim 3, wherein after the attaching the first effect in the target element, the method further comprises:

triggering a timer according to the first special effect to obtain the duration time of the first special effect;

if the duration of the first special effect is larger than a third threshold, updating the target element, wherein the updated target element comprises a second special effect.

6. The method according to any one of claims 1 to 5, wherein if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range to perform interaction between the target element and other elements in the explosion range, comprises:

if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range;

determining a center point of the detonation range;

determining distance information of the other elements according to the central point, wherein the distance information is set based on relative distances of the other elements;

and determining the interaction parameters of the target element and the other elements according to the distance information, and determining the corresponding special effect to be displayed in the user interface.

7. The method of claim 1, wherein the method of element interaction is applied to a terminal device, and wherein the terminal device is a block node device in a block chain node.

8. An apparatus for interacting elements in a user interface, comprising:

the acquisition unit is used for acquiring a collision box of the target element, and the collision box is determined based on a model display mode of the target element in the user interface;

the triggering unit is used for triggering ray detection according to rays generated by a user element so as to determine an interaction parameter, wherein the user element is used for indicating operation information of a user, and the interaction parameter is used for indicating the interaction degree of the operation information and the collision box of the target element;

the determining unit is used for determining the change condition of the target element according to the interaction parameters, wherein the change condition comprises the missing of the element in the target element, the addition of a specified element or the deformation of the element;

and the interaction unit is used for triggering explosion detection and determining an explosion range if the change condition of the target element meets a preset condition so as to interact the target element with other elements in the explosion range and determine a corresponding special effect to be displayed in the user interface.

9. A computer device, the computer device comprising a processor and a memory:

the memory is used for storing program codes; the processor is configured to perform the method of element interaction in a user interface of any one of claims 1 to 7 according to instructions in the program code.

10. A computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform the method of element interaction in a user interface of claims 1 to 7 above.

Technical Field

The present application relates to the field of computer technologies, and in particular, to a method and a related apparatus for element interaction in a user interface.

Background

With the development of computer technology, the frequency of human-computer interaction is more and more frequent, and higher requirements are also put forward for diversity in the interaction process.

In the current mobile terminal shooting game, on one hand, a plurality of objects or articles are arranged in a scene, which is mainly used for furnishing beautification to increase the visual perception of a user in the game, and on the other hand, a plurality of elements for indicating the operation of the user are added and interactive logic is provided to perform a man-machine interactive process.

However, in the above interaction process, many objects or articles are laid in the scene and do not directly participate in the human-computer interaction process, and related personnel need to separately design fixed scene elements and interaction scene elements, which increases the workload of related personnel, causes the problem of resource waste, and also affects the interaction experience of the target user.

Disclosure of Invention

In view of this, a first aspect of the present application provides a method for element interaction in a user interface, which is applicable to a mobile shooting game, and specifically includes: acquiring a collision box of a target element, wherein the collision box is determined based on a model display mode of the target element in the user interface;

triggering ray detection according to rays generated by a user element to determine an interaction parameter, wherein the user element is used for indicating operation information of a user, and the interaction parameter is used for indicating the interaction degree of the operation information and a collision box of the target element;

determining the change condition of the target element according to the interaction parameter, wherein the change condition comprises the missing of the element in the target element, the addition of a specified element or the deformation of the element;

and if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range so as to carry out interaction between the target element and other elements in the explosion range, and determining that a corresponding special effect is displayed in the user interface.

Preferably, in some possible implementations of the present application, before the acquiring the collision box of the target element, the method includes:

acquiring a ray range generated by the user element, wherein the ray range is set based on ray parameters of the user element, and the ray parameters are used for indicating state information of a user in the user interface;

and if the target element is within the ray range, acquiring a collision box of the target element.

Preferably, in some possible implementations of the present application, the determining a change condition of the target element according to the interaction parameter includes:

if the interaction parameter is larger than a first threshold value, adding a first special effect to the target element;

triggering parameter statistics of a second special effect according to the first special effect to obtain a second special effect parameter;

if the second special effect parameter is larger than a second threshold value, the target element is updated, and the updated target element comprises a second special effect.

Preferably, in some possible implementation manners of the present application, the triggering parameter statistics of the second special effect according to the first special effect to obtain the second special effect parameter includes:

triggering calculation of a tapering function according to the first special effect, the tapering function being used to indicate a change in a pixel value of the first special effect;

and if the user element stops generating the ray, stopping the calculation of the gradient function to obtain a second special effect parameter.

Preferably, in some possible implementations of the present application, after the adding the first special effect to the target element, the method further includes:

triggering a timer according to the first special effect to obtain the duration time of the first special effect;

if the duration of the first special effect is larger than a third threshold, updating the target element, wherein the updated target element comprises a second special effect.

Preferably, in some possible implementation manners of the present application, if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range, so as to perform interaction between the target element and other elements in the explosion range, including:

if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range;

determining a center point of the detonation range;

determining distance information of the other elements according to the central point, wherein the distance information is set based on relative distances of the other elements;

and determining the interaction parameters of the target element and the other elements according to the distance information, and determining the corresponding special effect to be displayed in the user interface.

Preferably, in some possible implementation manners of the present application, the element interaction method is applied to a terminal device, and the terminal device is a block node device in a block chain node.

A second aspect of the present application provides an apparatus for element interaction in a user interface, including: the acquisition unit is used for acquiring a collision box of the target element, and the collision box is determined based on a model display mode of the target element in the user interface;

the triggering unit is used for triggering ray detection according to rays generated by a user element so as to determine an interaction parameter, wherein the user element is used for indicating operation information of a user, and the interaction parameter is used for indicating the interaction degree of the operation information and the collision box of the target element;

the determining unit is used for determining the change condition of the target element according to the interaction parameters, wherein the change condition comprises the missing of the element in the target element, the addition of a specified element or the deformation of the element;

and the interaction unit is used for triggering explosion detection and determining an explosion range if the change condition of the target element meets a preset condition so as to interact the target element with other elements in the explosion range and determine a corresponding special effect to be displayed in the user interface.

Preferably, in some possible implementations of the present application, the obtaining unit is specifically configured to obtain a ray range generated by the user element, where the ray range is set based on a ray parameter of the user element, and the ray parameter is used to indicate state information of a user in the interface;

the acquiring unit is specifically configured to acquire a collision box of the target element if the target element is within the range of the ray.

Preferably, in some possible implementations of the present application, the determining unit is specifically configured to attach a first special effect to the target element if the interaction parameter is greater than a first threshold;

the determining unit is specifically configured to trigger parameter statistics of a second special effect according to the first special effect to obtain a second special effect parameter;

the determining unit is specifically configured to update the target element if the second special effect parameter is greater than a second threshold, where the updated target element includes a second special effect.

Preferably, in some possible implementations of the present application, the determining unit is specifically configured to trigger calculation of a gradient function according to the first special effect, where the gradient function is used to indicate a change in a pixel value of the first special effect;

the determining unit is specifically configured to stop the calculation of the gradient function to obtain a second special effect parameter if the user element stops generating the ray.

Preferably, in some possible implementations of the present application, the determining unit is further configured to trigger a timer according to the first special effect to obtain a duration of the first special effect;

the determining unit is further configured to update the target element if the duration of the first special effect is greater than a third threshold, where the updated target element includes a second special effect.

Preferably, in some possible implementation manners of the present application, the interaction unit is specifically configured to trigger explosion detection and determine an explosion range if a change condition of the target element meets a preset condition;

the interaction unit is specifically used for determining a central point of the explosion range;

the interaction unit is specifically configured to determine distance information of the plurality of other elements according to the central point, where the distance information is set based on relative distances of the plurality of other elements;

the interaction unit is specifically configured to determine the interaction parameters of the target element and the plurality of other elements according to the distance information, and determine that a corresponding special effect is displayed in the user interface.

A third aspect of the present application provides a computer device comprising: a memory, a processor, and a bus system; the memory is used for storing program codes; the processor is configured to perform the method of element interaction in a user interface according to any one of the first aspect or the first aspect, according to instructions in the program code.

A fourth aspect of the present application provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of element interaction in a user interface according to the first aspect or any one of the first aspects.

According to the technical scheme, the embodiment of the application has the following advantages: the method comprises the steps of determining interaction parameters by acquiring a collision box of a target element and triggering ray detection according to rays generated by a user element, wherein the user element is used for indicating operation information of a user; determining the change condition of the target element according to the interaction parameters, wherein the change condition comprises the missing of the element in the target element, the addition of a specified element or the deformation of the element; and then if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range so as to interact the target element with other elements in the explosion range, and determining that a corresponding special effect is displayed in the user interface. Because the target elements are merged into the interactive scene of the user elements, the elements in the user interface are richer, the utilization rate of resources is improved, and the effect of improving the user experience is achieved.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.

FIG. 1 is a diagram of a network architecture in which an element interaction system operates;

FIG. 2 is a flow chart of a method for element interaction according to an embodiment of the present disclosure;

fig. 3 is a schematic view of a scenario provided in an embodiment of the present application;

fig. 4 is a schematic view of another scenario provided in the embodiment of the present application;

fig. 5 is a schematic view of another scenario provided in the embodiment of the present application;

fig. 6 is a schematic view of another scenario provided in the embodiment of the present application;

fig. 7 is a schematic view of another scenario provided in the embodiment of the present application;

fig. 8 is a schematic view of another scenario provided in the embodiment of the present application;

fig. 9 is a schematic view of another scenario provided in the embodiment of the present application;

FIG. 10 is a flow chart of another method for element interaction provided by embodiments of the present application;

FIG. 11 is a schematic structural diagram of an element interaction apparatus according to an embodiment of the present application;

FIG. 12 is a schematic structural diagram of another element interaction apparatus according to an embodiment of the present application;

fig. 13A is a schematic diagram of a data sharing system according to an embodiment of the present application;

fig. 13B is a block composition diagram of a data sharing system according to an embodiment of the present application;

fig. 13C is a schematic diagram of a data transmission response of a blockchain node according to an embodiment of the present application.

Detailed Description

The embodiment of the application provides an element interaction method and a related device, which can be applied to a mobile terminal shooting game, specifically, a collision box of a target element is obtained, and then ray detection is triggered according to rays generated by a user element to determine an interaction parameter, wherein the user element is used for indicating operation information of a user; determining the change condition of the target element according to the interaction parameters, wherein the change condition comprises the missing of the element in the target element, the addition of a specified element or the deformation of the element; and then if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range so as to interact the target element with other elements in the explosion range, and determining that a corresponding special effect is displayed in the user interface. Because the target elements are merged into the interactive scene of the user elements, the elements in the user interface are richer, the utilization rate of resources is improved, and the effect of improving the user experience is achieved.

The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "corresponding" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.

It should be understood that the element interaction method provided by the present application may be applied to an operation process of an element interaction system, specifically, the element interaction system may operate in a network architecture as shown in fig. 1, and is a network architecture diagram of the operation of the element interaction system as shown in fig. 1, as can be seen from the figure, the element interaction system may provide element interaction with a plurality of information sources, receive operation information of a user on a user element through different terminal devices, and then participate in an interaction process including a target element or other elements, it is understood that various terminal devices are shown in fig. 1, specifically, the element interaction system may be a shooting game, the terminal may be a mobile terminal, a notebook computer, a tablet computer, and the like, and in an actual scene, more or fewer terminal devices may participate in the element interaction process, the specific number and kind are determined by the actual scene, and are not limited herein.

It is understood that the element interaction system may be operated in a personal mobile terminal, a server, or a third-party device to provide element interaction, so as to obtain a matching result of information source semantics, for example: in an actual scene, the element interaction system runs in the mobile terminal, and when a user operates a user element to shoot a target element, the user element interacts with other elements through the target element; the specific element interaction system may be operated in the above-mentioned device in the form of a program, may also be operated as a system component in the above-mentioned device, and may also be used as one of cloud service programs, and a specific operation mode is determined by an actual scene, which is not limited herein.

With the development of computer technology, the frequency of human-computer interaction is more and more frequent, and higher requirements are also put forward for diversity in the interaction process.

In the current mobile terminal shooting game, on one hand, a plurality of objects or articles are arranged in a scene, which is mainly used for furnishing beautification to increase the visual perception of a user in the game, and on the other hand, a plurality of elements for indicating the operation of the user are added and interactive logic is provided to perform a man-machine interactive process.

However, in the above interaction process, many objects or articles are laid in the scene and do not directly participate in the human-computer interaction process, and related personnel need to separately design fixed scene elements and interaction scene elements, which increases the workload of related personnel, causes the problem of resource waste, and also affects the interaction experience of the target user.

In order to solve the above problem, the present application provides a method for element interaction, which is described below with reference to fig. 2, where fig. 2 is a flowchart of a method for element interaction provided in an embodiment of the present application, and the embodiment of the present application at least includes the following steps:

201. a collision box of the target element is acquired.

In this embodiment, a shooting game is taken as an example to explain the element interaction method provided by the present application, as shown in fig. 3, fig. 3 is a scene schematic diagram provided by the present application embodiment, a vehicle in the diagram is a target element, and a collision box of the target element is a hit detection box indicated by a green collision box in the diagram.

It will be appreciated that the collision box is determined based on the way the target element is displayed in the user interface in the model, i.e. according to the way the model is built in a particular program, for example: and the program adopts end point connection modeling, and then determines a collision box according to the end point of the target element.

Optionally, in the shooting game, the interaction manner between the user element and the target element is mainly shooting, and there may be a certain range of shooting, so before acquiring the collision box of the target element, a ray range generated by the user element may also be acquired, where the ray range is set based on a ray parameter of the user element, and the ray parameter is used to indicate the state information of the user in the interface; and if the target element is within the ray range, acquiring a collision box of the target element.

202. Ray detection is triggered based on the radiation generated by the user element to determine interaction parameters.

In this embodiment, the user element is used to indicate operation information of a user, and the interaction parameter is used to indicate a degree of interaction between the operation information and a collision box of the target element, where in the shooting game, the degree of interaction is a hit of a bullet fired by the user element on the target element.

203. And determining the change condition of the target element according to the interaction parameters.

In this embodiment, the change condition includes absence of an element in the target element, addition of a specified element, or deformation of an element, for example: the missing of the element is the wheel loss of the automobile in fig. 3, the addition of the specified element is the additional smoking effect of the automobile in fig. 3, the deformation of the element is the damage of the automobile model in fig. 3, and the like, and the specific form is determined by the actual scene.

Alternatively, the change condition of the target element may be a gradual presentation, that is, a plurality of effects are set, and the corresponding effects are realized based on the change of the interaction parameter. Specifically, if the interaction parameter is greater than a first threshold, a first special effect is added to the target element; triggering parameter statistics of a second special effect according to the first special effect to obtain a second special effect parameter; if the second special effect parameter is larger than a second threshold value, the target element is updated, and the updated target element comprises a second special effect.

In a possible scenario, the first special effect is smoke or a bullet hole, and the second special effect is explosion, as shown in fig. 4, fig. 4 is another scenario diagram provided in this embodiment of the present application, and after a user element shoots a target element, the target element is attached with special effects of the bullet hole and the thin smoke.

It is understood that, to further enhance the interaction experience, the change of the special effect may be gradual, that is, a gradual function is triggered to be calculated according to the first special effect, and the gradual function is used for indicating the change of the pixel value of the first special effect; and if the user element stops generating the ray, stopping the calculation of the gradient function to obtain a second special effect parameter. Specifically, as shown in fig. 5, fig. 5 is another scene schematic diagram provided in the embodiment of the present application, after a certain degree of impact, the vehicle starts to emit dense smoke, that is, after the certain degree of impact, the pixel value of the thin smoke changes, and after the certain degree of impact, the form of fig. 6 may also be adopted, and fig. 6 is another scene schematic diagram provided in the embodiment of the present application, that is, another scene schematic diagram is provided in the embodiment of the present application, that is, a special effect of flame is displayed.

In addition, in a possible scenario, the user element stops shooting, and the target element may also trigger the second special effect, that is, trigger a timer according to the first special effect to obtain the duration of the first special effect; if the duration of the first special effect is larger than a third threshold, updating the target element, wherein the updated target element comprises a second special effect. For example: after the vehicle (target element) is ignited by a soldier (user element), the vehicle (target element) explodes after a certain time.

204. And if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range so as to carry out interaction between the target element and other elements in the explosion range, and determining that a corresponding special effect is displayed in the user interface.

In this embodiment, the other elements are elements around the target element, which may be controlled by the user or may be non-controllable elements in the scene, as shown in fig. 7, fig. 7 is another schematic view of the scene provided in the embodiment of the present application, and a soldier standing behind the target element is the other elements; as shown in fig. 8, another scenario diagram provided in the embodiment of the present application is that after a vehicle explodes, the target element may trigger interaction with other elements.

Optionally, the setting of explosion may be in a range, and the distance change in the interaction manner may also be changed, specifically, if the change condition of the target element meets a preset condition, explosion detection is triggered and the explosion range is determined; then determining the central point of the explosion range; next determining distance information of a plurality of other elements according to the central point, wherein the distance information is set based on relative distances of the other elements; and then determining the interaction parameters of the target element and the other elements according to the distance information, and determining that the corresponding special effect is displayed in the user interface. As shown in fig. 9, another scenario diagram provided for the embodiment of the present application shows a possible explosion range diagram, and a range with a relative distance of an explosion center of 3 is an explosion range, and if other elements exist in the explosion range, interaction is performed, and a specific interaction manner may be calculation of life values of the other elements or calculation of exclusion distances.

With the above embodiment, the interaction parameters are determined by acquiring the collision box of the target element and triggering ray detection according to the rays generated by the user element, wherein the user element is used for indicating the operation information of the user; determining the change condition of the target element according to the interaction parameters, wherein the change condition comprises the missing of the element in the target element, the addition of a specified element or the deformation of the element; and then if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range so as to interact the target element with other elements in the explosion range, and determining that a corresponding special effect is displayed in the user interface. Because the target elements are merged into the interactive scene of the user elements, the elements in the user interface are richer, the utilization rate of resources is improved, and the effect of improving the user experience is achieved.

The foregoing embodiment introduces an interaction process of multiple elements in various scenarios, and in practical applications, the scenarios may also be determined based on a step, which is described below, as shown in fig. 10, where fig. 10 is a flowchart of another method for interacting elements provided in this embodiment of the present application.

Firstly, a player moves to the side of an automobile which can be exploded and fires the automobile; then judging whether the automobile is attacked or not, wherein the judgment mode is that the automobile is hung on a collision box through ray detection, when the automobile collision box is detected through rays, the special effect which the automobile is required to display is displayed, and only a bullet hole special effect is displayed at the beginning stage; then, when the automobile is hit to a certain degree, black smoke is displayed, and the hit degree shows which special effect is determined by the configuration, for example, the blood volume of the automobile is 100, thin smoke is displayed when 60 is left, and thick smoke is displayed when 50 is left; when the blood volume is too low, a special effect of burning is played under the condition of simultaneously playing black smoke, the playing mode is simple, the position of the automobile is obtained, and then the special effect is played on the position; when the automobile is burnt, the player can choose whether to continue attacking, if so, the automobile can explode immediately under the attack, then people around the automobile are all exploded, if the player does not attack, the automobile can explode automatically along with the time, and the explosion injury is the player within 3 meters of the calculated explosion point range; and finally, the automobile becomes a scrap iron automobile model after explosion, cannot be attacked any more and cannot explode any more, and becomes the same as other static objects.

In order to better implement the above-mentioned aspects of the embodiments of the present application, the following also provides related apparatuses for implementing the above-mentioned aspects. Referring to fig. 11, fig. 11 is a schematic structural diagram of an element interaction device according to an embodiment of the present application, where the element interaction device 1100 includes:

an obtaining unit 1101, configured to obtain a collision box of a target element, where the collision box is determined based on a model display manner of the target element in the user interface;

a triggering unit 1102, configured to trigger ray detection according to a ray generated by a user element to determine an interaction parameter, where the user element is used to indicate operation information of a user, and the interaction parameter is used to indicate an interaction degree of the operation information with a collision box of the target element;

a determining unit 1103, configured to determine, according to the interaction parameter, a change condition of the target element, where the change condition includes absence of an element in the target element, addition of a specified element, or deformation of the element;

an interaction unit 1104, configured to trigger explosion detection and determine an explosion range if a change condition of the target element meets a preset condition, so as to perform interaction between the target element and other elements in the explosion range, and determine that a corresponding special effect is displayed in the user interface.

Preferably, in some possible implementations of the present application, the obtaining unit 1101 is specifically configured to obtain a ray range generated by the user element, where the ray range is set based on a ray parameter of the user element, and the ray parameter is used to indicate state information of a user in the interface;

the obtaining unit 1101 is specifically configured to obtain a collision box of the target element if the target element is within the range of the ray.

Preferably, in some possible implementations of the present application, the determining unit 1103 is specifically configured to attach a first special effect to the target element if the interaction parameter is greater than a first threshold;

the determining unit 1103 is specifically configured to trigger parameter statistics of a second special effect according to the first special effect to obtain a second special effect parameter;

the determining unit 1103 is specifically configured to, if the second special effect parameter is greater than a second threshold, update the target element, where the updated target element includes a second special effect.

Preferably, in some possible implementations of the present application, the determining unit 1103 is specifically configured to trigger calculation of a gradient function according to the first special effect, where the gradient function is used to indicate a change in a pixel value of the first special effect;

the determining unit 1103 is specifically configured to stop the calculation of the gradient function to obtain a second special effect parameter if the user element stops generating the ray.

Preferably, in some possible implementations of the present application, the determining unit 1103 is further configured to trigger a timer according to the first special effect to obtain a duration of the first special effect;

the determining unit 1103 is further configured to update the target element if the duration of the first special effect is greater than a third threshold, where the updated target element includes a second special effect.

Preferably, in some possible implementation manners of the present application, the interaction unit 1104 is specifically configured to trigger explosion detection and determine an explosion range if a change condition of the target element meets a preset condition;

the interaction unit 1104 is specifically configured to determine a central point of the explosion range;

the interaction unit 1104 is specifically configured to determine distance information of the plurality of other elements according to the central point, where the distance information is set based on relative distances of the plurality of other elements;

the interaction unit 1104 is specifically configured to determine the interaction parameters of the target element and the multiple other elements according to the distance information, and determine that a corresponding special effect is displayed in the user interface.

The method comprises the steps of determining interaction parameters by acquiring a collision box of a target element and triggering ray detection according to rays generated by a user element, wherein the user element is used for indicating operation information of a user; determining the change condition of the target element according to the interaction parameters, wherein the change condition comprises the missing of the element in the target element, the addition of a specified element or the deformation of the element; and then if the change condition of the target element meets a preset condition, triggering explosion detection and determining an explosion range so as to interact the target element with other elements in the explosion range, and determining that a corresponding special effect is displayed in the user interface. Because the target elements are merged into the interactive scene of the user elements, the elements in the user interface are richer, the utilization rate of resources is improved, and the effect of improving the user experience is achieved.

Referring to fig. 12, fig. 12 is a schematic structural diagram of another element interaction apparatus provided in this embodiment, where the element interaction apparatus 1200 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 1222 (e.g., one or more processors) and a memory 1232, and one or more storage media 1230 (e.g., one or more mass storage devices) storing an application program 1242 or data 1244. Memory 1232 and storage media 1230 can be, among other things, transient storage or persistent storage. The program stored in the storage medium 1230 may include one or more modules (not shown), each of which may include a sequence of instructions operating on an element interaction device. Still further, the central processor 1222 may be configured to communicate with the storage medium 1230, to execute a series of instruction operations in the storage medium 1230 on the element interaction device 1200.

The element interaction device 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input-output interfaces 1258, and/or one or more operating systems 1241, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.

The steps performed by the element interaction means in the above embodiments may be based on the structure of the element interaction means shown in fig. 11.

Also provided in the embodiments of the present application is a computer-readable storage medium, which stores element interaction instructions, and when the computer-readable storage medium is executed on a computer, the computer is caused to perform the steps performed by the element interaction apparatus in the method described in the foregoing embodiments shown in fig. 2 to 10.

Also provided in the embodiments of the present application is a computer program product including element interaction instructions, which when run on a computer, cause the computer to perform the steps performed by the element interaction apparatus in the method described in the foregoing embodiments shown in fig. 2 to 10.

An element interaction system is also provided in the embodiments of the present application, and the element interaction system may include the element interaction apparatus in the embodiment described in fig. 11, or the element interaction apparatus described in fig. 12.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an element interaction device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

In addition, the method and apparatus for element interaction may also be applied to a data sharing system, see the data sharing system shown in fig. 13A, where the data sharing system 1300 refers to a system for performing data sharing between nodes, the data sharing system may include a plurality of nodes 1301, and the plurality of nodes 1301 may refer to respective clients in the data sharing system, where each client operates on a terminal device corresponding to the method according to the present application. Each node 1301 may receive input information during normal operation and maintain shared data within the data sharing system based on the received input information. In order to ensure information intercommunication in the data sharing system, information connection can exist between each node in the data sharing system, and information transmission can be carried out between the nodes through the information connection. For example, when an arbitrary node in the data sharing system receives input information, other nodes in the data sharing system acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all the nodes in the data sharing system are consistent.

Each node in the data sharing system has a node identifier corresponding thereto, and each node in the data sharing system may store a node identifier of another node in the data sharing system, so that the generated block is broadcast to the other node in the data sharing system according to the node identifier of the other node in the following. Each node may maintain a node identifier list as shown in the following table, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol) address and any other information that can be used to identify the node, and table 1 only illustrates the IP address as an example.

TABLE 1 node and node identification correspondence

Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258

Each node in the data sharing system stores one identical blockchain. The block chain is composed of a plurality of blocks, as shown in fig. 13B, the block chain is composed of a plurality of blocks, the starting block includes a block header and a block main body, the block header stores an input information characteristic value, a version number, a timestamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.

When each block in the block chain is generated, referring to fig. 13C, when the node where the block chain is located receives the input information, the input information is verified, after the verification is completed, the input information is stored in the memory pool, and the hash tree for recording the input information is updated; and then, updating the updating time stamp to the time when the input information is received, trying different random numbers, and calculating the characteristic value for multiple times, so that the calculated characteristic value can meet the following formula:

SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET

wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block head characteristic value of a parent block of the current block; merkle _ root is a characteristic value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits.

Therefore, when the random number meeting the formula is obtained through calculation, the information can be correspondingly stored, and the block head and the block main body are generated to obtain the current block. And then, the node where the block chain is located respectively sends the newly generated blocks to other nodes in the data sharing system where the newly generated blocks are located according to the node identifications of the other nodes in the data sharing system, the newly generated blocks are verified by the other nodes, and the newly generated blocks are added to the block chain stored in the newly generated blocks after the verification is completed.

The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:虚拟对象的控制方法、装置、终端及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类