Installation package generation method, device, equipment and storage medium
By simulating the motion state of real objects under gravity in the matching page of social applications and displaying user icons, the problem of lack of innovation in the display method of matching pages in the existing technology is solved and the user experience is improved.
Patent Information
- Application Number
- CN202111461869.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-12-02
AI Technical Summary
The lack of innovation in how matching pages of existing social applications are displayed, resulting in poor user experience.
By creating physical behavior manager objects, gravity behavior objects, object objects and coordinate manager objects, simulate the motion state of real objects under gravity, and display user icons in the matching page of social applications.
It enriches the display method of matching pages, increases the fun of matching interfaces, and improves the user experience.
Smart Images

Figure CN114237569B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an installation package generation method, device, equipment and storage medium. Background Art
[0002] With the rapid development of computer technology, there are more and more APPs (Applications) that provide users with various functions. For example, a user (which may be referred to as a first user) can communicate with other users (which may be referred to as second users) through a social application. When the first user uses a social application, the social application may also recommend a second user to the user. For example, a social application may display a matching page, which displays icons of multiple second users in a list. When the first user needs to communicate with one of the second users, he or she may click on the icon of the second user. Accordingly, the social application may display a chat page with the second user. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a method, device, equipment and storage medium for generating an installation package, so as to enrich the display mode of the matching page of the social application, increase the fun of the matching interface, and improve the user experience. The specific technical solution is as follows:
[0004] In a first aspect of the present invention, a method for generating an installation package is provided, the method comprising:
[0005] Create a physics behavior manager object;
[0006] Creating a view object of a target view for displaying a user icon, and adding the physical behavior manager object to the view object;
[0007] Create a gravity behavior class, and set the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein the attribute value of the direction attribute represents the movement speed of the user icon in the target view; and the attribute value of the angle attribute represents the movement direction of the user icon in the target view;
[0008] Creating an object class, and setting the attribute value of the element attribute of the object class to obtain an object object; wherein the object object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the displayed content in the user icon, and the initial position of the user icon in the target view;
[0009] Create a coordinate manager class, and set the attribute value of the accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the time interval for the accelerometer of the terminal to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system; the coordinate manager object is used to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculate the current gravity angle of the terminal based on the obtained accelerations, and assign the calculated gravity angle to the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
[0010] Adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain a source program of a social application;
[0011] The source program is compiled to obtain an installation package of the social application; wherein the social application is used to display the user icon in the target view with the direction represented by the current attribute value of the angle attribute as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position.
[0012] Optionally, before adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain the source program of the social application, the method further includes:
[0013] Create a collision behavior class, set the attribute value of the boundary attribute and the attribute value of the collision attribute of the collision behavior class, and obtain a collision behavior object; wherein the attribute value of the boundary attribute represents the boundary of the target area in the target view that supports the collision behavior of the user icon; the attribute value of the collision attribute represents whether the collision behavior between user icons is supported in the target area, and whether the collision behavior between the user icon and the boundary of the target area is supported;
[0014] The step of adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain a source program of a social application includes:
[0015] The gravity behavior object and the collision behavior object are added to the physical behavior manager object, the object object is added to the view object, and the object object is added to the gravity behavior object and the collision behavior object respectively to obtain the source program of the social application.
[0016] Optionally, the boundary of the target area in the target view that supports the collision of the user icons is the boundary of the target view; the target area supports collisions between user icons and collisions between user icons and the boundary of the target area.
[0017] Optionally, before adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object and the collision behavior object respectively to obtain the source program of the social application, the method further includes:
[0018] Create a dynamic behavior class, set the attribute value of the elasticity coefficient attribute and the attribute value of the friction coefficient attribute of the dynamic behavior class, and obtain a dynamic behavior object; wherein the attribute value of the elasticity coefficient attribute represents the numerical value of the change in the movement speed of the user icon after the collision behavior occurs, and the movement direction relative to the movement direction before the collision behavior occurs; the attribute value of the friction coefficient attribute represents the numerical value of the reduction in the movement speed of the user icon when the user icon moves a preset number of pixels in the target view;
[0019] The adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object and the collision behavior object respectively to obtain a source program of a social application, comprises:
[0020] Add the gravity behavior object, the collision behavior object and the dynamic behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object, the dynamic behavior object and the collision behavior object respectively to obtain the source program of the social application.
[0021] In a second aspect of the present invention, there is provided an installation package generation device, the device comprising:
[0022] Manager creation module, used to create physical behavior manager objects;
[0023] A view creation module, used to create a view object of a target view for displaying a user icon, and add the physical behavior manager object to the view object;
[0024] A gravity behavior creation module, used to create a gravity behavior class, and set the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein the attribute value of the direction attribute represents the movement speed of the user icon in the target view; the attribute value of the angle attribute represents the movement direction of the user icon in the target view;
[0025] An object creation module, used to create an object class, and set the attribute value of the element attribute of the object class to obtain an object object; wherein the object object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view;
[0026] A coordinate manager creation module, used to create a coordinate manager class, and set the attribute value of the accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the time interval at which the accelerometer of the terminal obtains the acceleration of the terminal on each coordinate axis of the terminal coordinate system; the coordinate manager object is used to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculate the current gravity angle of the terminal based on the obtained accelerations, and assign the calculated gravity angle as the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
[0027] An adding module, used to add the gravity behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object to obtain a source program of a social application;
[0028] A compilation module is used to compile the source program to obtain an installation package of the social application; wherein the social application is used to display the user icon in the target view with the direction represented by the current attribute value of the angle attribute as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position.
[0029] Optionally, the device further comprises:
[0030] A collision behavior creation module, used for creating a collision behavior class, setting the attribute value of the boundary attribute and the attribute value of the collision attribute of the collision behavior class, and obtaining a collision behavior object before the adding module executes adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain a source program of the social application; wherein the attribute value of the boundary attribute represents the boundary of the target area in the target view that supports the collision behavior of the user icon; the attribute value of the collision attribute represents whether the collision behavior between user icons is supported in the target area, and whether the collision behavior between the user icon and the boundary of the target area is supported;
[0031] The adding module is specifically used to add the gravity behavior object and the collision behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object and the collision behavior object respectively to obtain the source program of the social application.
[0032] Optionally, the boundary of the target area in the target view that supports the collision of the user icons is the boundary of the target view; the target area supports collisions between user icons and collisions between user icons and the boundary of the target area.
[0033] Optionally, the device further comprises:
[0034] A dynamic behavior creation module, used for, before the adding module executes adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object object to the view object, and respectively adding the object object to the gravity behavior object and the collision behavior object, and obtaining the source program of the social application, executing creation of a dynamic behavior class, setting the attribute value of the elasticity coefficient attribute and the attribute value of the friction coefficient attribute of the dynamic behavior class, and obtaining the dynamic behavior object; wherein the attribute value of the elasticity coefficient attribute represents the numerical value of the change in the movement speed of the user icon after the collision behavior occurs, and the movement direction relative to the movement direction before the collision behavior occurs; the attribute value of the friction coefficient attribute represents the numerical value of the reduction in the movement speed of the user icon when the user icon moves a preset number of pixels in the target view;
[0035] The adding module is specifically used to add the gravity behavior object, the collision behavior object and the dynamic behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object, the dynamic behavior object and the collision behavior object respectively to obtain the source program of the social application.
[0036] An embodiment of the present invention further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0037] Memory, used to store computer programs;
[0038] The processor is used to implement any of the above-mentioned steps of the installation package generation method when executing the program stored in the memory.
[0039] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements any of the above-mentioned steps of the method for generating an installation package.
[0040] An embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned methods for generating an installation package.
[0041] Beneficial effects of the embodiments of the present invention:
[0042] An installation package generation method provided by an embodiment of the present invention can create a physical behavior manager object, create a view object of a target view for displaying a user icon, and add the physical behavior manager object to the view object; create a gravity behavior class, and set the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object; the attribute value of the direction attribute represents the movement speed of the user icon in the target view; the attribute value of the angle attribute represents the movement direction of the user icon in the target view; create an object class, and set the attribute value of the element attribute of the object class to obtain an object object; the object object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view; create a coordinate manager class, and set the attribute value of the accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; the attribute value of the accelerometer attribute represents: the final The accelerometer of the terminal obtains the time interval of the acceleration of the terminal on each coordinate axis of the terminal coordinate system; the coordinate manager object is used to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculate the gravity angle of the terminal based on the obtained accelerations, and assign the calculated gravity angle to the current attribute value of the angle attribute; the gravity angle of the terminal represents the angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction; the gravity behavior object is added to the physical behavior manager object, the object object is added to the view object, and the object object is added to the gravity behavior object to obtain the source program of the social application; the source program is compiled to obtain the installation package of the social application; the social application is used to display the user icon in the target view with the direction represented by the current attribute value of the angle attribute as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position.
[0043] Based on the above processing, a gravity behavior object and an object object are added to the view object of the target view of the social application. The social application can determine the current gravity angle of the terminal through the coordinate manager object, and assign it to the current attribute value of the angle attribute of the gravity behavior object. The attribute value of the angle attribute can represent the running direction of the user icon represented by the object object. Correspondingly, the direction represented by the current gravity angle of the terminal can be used as the movement direction, and the movement speed represented by the attribute value of the direction attribute can be used as the initial movement speed to display the user icon in the target view. Since the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, the angle can represent the direction of the terminal relative to the ground, that is, when the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction changes, that is, when the direction of the terminal relative to the ground changes, the user icon can be displayed in the matching page of the social application according to the movement state of the real object under the action of gravity, which enriches the display method of the matching page, increases the fun of the matching interface, and improves the user experience.
[0044] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0046] Figure 1 A flowchart of a method for generating an installation package provided by an embodiment of the present invention;
[0047] FIG2( a) is a schematic diagram of a terminal coordinate system provided by an embodiment of the present invention;
[0048] FIG2( b) is a schematic diagram of another terminal coordinate system provided by an embodiment of the present invention;
[0049] FIG3( a) is a schematic diagram of a matching page of a social application provided by an embodiment of the present invention;
[0050] FIG3( b) is a schematic diagram of a matching page of another social application provided by an embodiment of the present invention;
[0051] Figure 4 A flowchart of another method for generating an installation package provided by an embodiment of the present invention;
[0052] Figure 5 A flowchart of another method for generating an installation package provided by an embodiment of the present invention;
[0053] Figure 6 A structural diagram of an installation package generating device provided by an embodiment of the present invention;
[0054] Figure 7 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.
[0056] See also Figure 1 , Figure 1A flowchart of a method for generating an installation package provided by an embodiment of the present invention, the method may include the following steps:
[0057] S101: Create a physical behavior manager object.
[0058] S102: Create a view object of a target view for displaying a user icon, and add a physical behavior manager object to the view object.
[0059] S103: Create a gravity behavior class, and set the attribute values of the direction attribute and the angle attribute of the gravity behavior class to obtain a gravity behavior object.
[0060] The attribute value of the direction attribute represents the movement speed of the user icon in the target view; and the attribute value of the angle attribute represents the movement direction of the user icon in the target view.
[0061] S104: Create an object class, and set attribute values of element attributes of the object class to obtain an object object.
[0062] The object represents the user icon, and the attribute value of the element attribute represents the size of the user icon, the displayed content in the user icon, and the initial position of the user icon in the target view.
[0063] S105: Create a coordinate manager class, and set the attribute value of the accelerometer attribute of the coordinate manager class to obtain a coordinate manager object.
[0064] Among them, the attribute value of the accelerometer attribute indicates: the time interval at which the accelerometer of the terminal obtains the acceleration of the terminal on each coordinate axis of the terminal coordinate system. The coordinate manager object is used to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculate the current gravity angle of the terminal based on the obtained accelerations, and assign the calculated gravity angle to the current attribute value of the angle attribute. The current gravity angle of the terminal indicates the angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction.
[0065] S106: Add the gravity behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object to obtain the source program of the social application.
[0066] S107: Compile the source program to obtain an installation package of the social application.
[0067] Among them, the social application is used to display the user icon in the target view with the direction represented by the current attribute value of the angle attribute as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position.
[0068] Based on the installation package generation method provided by the embodiment of the present invention, a gravity behavior object and an object object are added to the view object of the target view of the social application. The social application can determine the current gravity angle of the terminal through the coordinate manager object, and assign it to the current attribute value of the angle attribute of the gravity behavior object. The attribute value of the angle attribute can represent the running direction of the user icon represented by the object object. Accordingly, the direction represented by the current gravity angle of the terminal can be used as the movement direction, and the movement speed represented by the attribute value of the direction attribute can be used as the initial movement speed to display the user icon in the target view. Since the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, the angle can represent the direction of the terminal relative to the ground, that is, when the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction changes, that is, when the direction of the terminal relative to the ground changes, the user icon can be displayed in the matching page of the social application according to the movement state of the real object under the action of gravity, which enriches the display mode of the matching page, increases the fun of the matching interface, and improves the user experience.
[0069] With respect to step S101 and step S102, when a user uses a social application, the social application may recommend other users to the user. For example, the social application may display user icons of other recommended users in a matching page.
[0070] The displayed content in the user icon may include a user avatar, a user name, and a user tag, etc. The user tag may be an interest tag set by the user, such as movies, sports, and travel, etc.
[0071] In order to enable the social application to display the user icon in the matching page, a matching page for displaying the user icon can be created for the social application, that is, a view object of a target view for displaying the user icon is created, and the view object is the source program of the matching page of the social application.
[0072] In order to display the user icon in the matching page according to the motion state of the object under the real gravity, a physical behavior manager object for managing physical behavior can be created and added to the view object of the target view. The physical behavior may include gravity behavior, collision behavior and dynamic behavior in subsequent embodiments.
[0073] The size of the target view may be the size of the display interface of the social application. Alternatively, the target view may also be a designated area in the display interface of the social application. Accordingly, other areas in the display interface of the social application other than the target view may display the matching method for the user, such as voice matching, video matching, etc.
[0074] For example, if the operating system running the social application is an IOS operating system, a UIDynamicAnimator (behavior manager) object can be created as a physical behavior manager object, and a View (view) object can be created as a view object of the target view, and the UIDynamicAnimator object can be added to the View object.
[0075] With respect to step S103, in order to display the user icon in the matching page of the social application according to the motion state of the real object under the action of gravity, a gravity behavior object may be created for the social application, and the gravity behavior object is used to simulate the motion state of the real object under the action of gravity.
[0076] In one implementation, a gravity behavior class may be created first. Then, the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class are set to obtain a gravity behavior object. The attribute value of the direction attribute of the gravity behavior object represents the movement speed of the user icon in the target view, and the attribute value of the angle attribute of the gravity behavior object represents the movement direction of the user icon in the target view.
[0077] Exemplarily, a UIGravityBehavior (gravity behavior) class may be created, and the attribute value of the gravityDirection attribute (i.e., the direction attribute in the embodiment of the present invention) of the gravity behavior class may be set to CGVectorMake(a, b). a represents the horizontal movement speed of the user icon when the user icon moves in the target view, and b represents the vertical movement speed of the user icon. In order to display the user icon in the target view according to the downward falling motion state of a real object under the action of gravity, a may be set to 0, that is, the user icon does not move in the horizontal direction, but only in the vertical direction.
[0078] In addition, the attribute value of the angle attribute of the gravity behavior class (i.e., the angle attribute in the embodiment of the present invention) can also be set, and the attribute value of the angle attribute is the angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction. For example, if the attribute value of the angle attribute is set to π / 2, the obtained gravity behavior object is a longitudinal gravity behavior object, because the attribute value of the angle attribute of the gravity behavior object represents the movement direction of the user icon in the target view, that is, the user icon can be made to move in the vertical direction.
[0079] With respect to step S104, in order to display the user icon in the created target view, an object object representing the user icon may also be created. In one implementation, an object class may be created, and then the attribute value of the element attribute of the object class may be set to obtain the object object. The attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view.
[0080] The initial position of the user icon in the target view is the position of the user icon in the target view before the user icon moves. For example, when the user icon is displayed in the target view according to the downward falling motion state of a real object under the action of gravity, the initial position may be the upper position in the target view.
[0081] Then, the gravity behavior object can be added to the physical behavior manager object, and the object object can be added to the target view and the gravity behavior object, and the source program of the social application can be obtained. Furthermore, the source program of the social application is compiled to obtain the installation package of the social application.
[0082] Accordingly, when running, the social application can display the user icon in the target view with the direction represented by the attribute value of the angle attribute of the gravity behavior object as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position.
[0083] Based on the above processing, user icons can be displayed in the matching page of the social application according to the movement state of the real object under the action of gravity, which enriches the display method of the matching page, increases the fun of the matching interface, and improves the user experience.
[0084] For step S105, the terminal is a device on which the social application runs, such as a mobile phone, a tablet computer, etc. The direction of the terminal relative to the ground will change. Since the direction of the terminal relative to the ground can be represented by the angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, that is to say, the angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction will also change. When the direction of the terminal relative to the ground changes, if the user icon still moves in the direction represented by the attribute value of the angle attribute of the gravity behavior object, at this time, the user icon cannot be displayed in the target view according to the downward falling motion state of the real object under the action of gravity.
[0085] For example, referring to FIG. 2(a), the terminal is in a vertical direction relative to the ground, and the terminal coordinate system includes an X-axis, a Y-axis, and a Z-axis. The X-axis is parallel to the upper edge of the terminal display screen, the Y-axis is parallel to the left edge of the terminal display screen, and the upward direction of the vertical terminal display screen is the positive direction of the Z-axis. The designated coordinate axis in the terminal coordinate system is the Y-axis.
[0086] In order to display the user icon in the target view according to the motion state of a real object falling downward under the action of gravity, the direction represented by the attribute value of the angle attribute of the gravity behavior object is the opposite direction of the Y axis. When the terminal is in a vertical direction relative to the ground, the Y axis of the terminal coordinate system is perpendicular to the horizontal direction, and the user icon moves in the opposite direction of the Y axis in the target view, the user icon can be displayed in the target view according to the motion state of a real object falling downward under the action of gravity.
[0087] When the direction of the terminal changes, as shown in Figure 2(b), the direction of the terminal relative to the ground is not vertical, and the Y-axis of the terminal coordinate system is not perpendicular to the horizontal direction. When the user icon moves in the opposite direction of the Y-axis in the target view, it cannot be displayed in the target view according to the movement state of a real object falling downward under the action of gravity.
[0088] Therefore, it is necessary to obtain the angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction after the direction of the terminal relative to the ground changes, and then adjust the movement direction of the user icon in the target view according to the obtained angle.
[0089] In one implementation, a coordinate manager class may be created, and the attribute value of the accelerometer attribute of the coordinate manager class may be set to obtain a coordinate manager object, and the accelerometer of the terminal may be turned on. The time interval may be set by a technician based on experience, for example, the time interval may be 0.2 seconds, or the time interval may be 0.3 seconds, but is not limited thereto.
[0090] For example, a CMMotionManager (mobile coordinate manager) class can be created, the attribute value of the accelerometerUpdateInterval (accelerometer time interval) attribute can be set to 0.2, and the accelerometer can be turned on. The accelerometerUpdateInterval attribute is an accelerometer attribute in an embodiment of the present invention, and the attribute value of the accelerometerUpdateInterval attribute indicates: the time interval for the accelerometer to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system, that is, the time interval for the accelerometer to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system is set to 0.2 seconds.
[0091] Correspondingly, when the social application runs on the terminal, the coordinate manager object can obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system at time intervals through the terminal's accelerometer, and calculate the current gravity angle of the terminal based on the obtained accelerations. The current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction.
[0092] For example, you can turn on the terminal's accelerometer by calling the startAccelerometerUpdatesToQueue:withHandler: method. The coordinate manager object can obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system through the accelerometer. This method can return CMAccelerometerData (accelerometer data), which contains the acceleration of the terminal on each coordinate axis of the terminal coordinate system. Then, the current gravity angle of the terminal is calculated through the atan2(y, x) function. atan2 is an inverse tangent function, where x represents the acceleration of the terminal on the X-axis of the terminal coordinate system, and y represents the acceleration of the terminal on the Y-axis of the terminal coordinate system. Since y is a negative number when the acceleration is downward, y needs to be negated (i.e. -y) when calculating the current gravity angle of the terminal.
[0093] Furthermore, the calculated current gravity angle of the terminal can be assigned as the current attribute value of the angle attribute. Subsequently, the user icon can be made to move in the target view in the direction represented by the current attribute value of the angle attribute. That is, based on the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, the movement direction of the user icon in the target view is adjusted. When the direction of the terminal relative to the ground changes, the user icon can still be displayed in the matching page of the social application according to the motion state of a real object falling downward under the action of gravity, which enriches the display method of the matching page, increases the fun of the matching interface, and improves the user experience.
[0094] For step S106 and step S107, the gravity behavior object can be added to the physical behavior manager object, and the object object can be added to the gravity behavior object and the view object of the target view, and the source program of the social application can be obtained. For example, the addBehavior (add behavior) method can be called to add the gravity behavior object to the UIDynamicAnimator object, and the addItem (add item) method can be called to add the object object to the gravity behavior object, and the object object can be added to the view object. Then, the source program of the social application is compiled to obtain the installation package of the social application.
[0095] Based on the above processing, the user icon can be displayed in the matching page of the social application according to the movement state of the real object under the action of gravity, and when the direction of the terminal relative to the ground changes, the user icon can still move in the matching page of the social application according to the movement state of the real object under the action of gravity, which enriches the display method of the matching page, increases the fun of the matching interface, and improves the user experience.
[0096] Exemplarily, referring to FIG3(a), when the direction of the terminal relative to the ground is vertical, the user icon can move in the vertical direction in the target view according to the motion state of a real object falling downward under the action of gravity. When the direction of the terminal relative to the ground changes, referring to FIG3(b), the user icon can still move in the vertical direction in the target view according to the motion state of a real object falling downward under the action of gravity.
[0097] In one embodiment of the present invention, Figure 1 Based on Figure 4 Before step S106, the method may further include the following steps:
[0098] S108: Create a collision behavior class, set the attribute value of the boundary attribute and the attribute value of the collision attribute of the collision behavior class, and obtain a collision behavior object.
[0099] Among them, the attribute value of the boundary attribute represents the boundary of the target area in the target view that supports the collision behavior of the user icons; the attribute value of the collision attribute represents whether the collision behavior between user icons in the target area is supported, and whether the collision behavior between the user icon and the boundary of the target area is supported.
[0100] Accordingly, step S106 may include the following steps:
[0101] S1061: Add the gravity behavior object and the collision behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object and the collision behavior object respectively to obtain the source program of the social application.
[0102] In order to simulate the motion state of a real object falling downward under the action of gravity, multiple user icons displayed in the target view can be set to collide. In one implementation, a collision behavior class can be created, and the attribute values of the boundary attribute and the collision attribute of the collision behavior class can be set to obtain a collision behavior object.
[0103] In one embodiment of the present invention, the boundary of the target area in the target view that supports the collision of user icons is the boundary of the target view; the target area supports the collision between user icons, and the collision between user icons and the boundary of the target area.
[0104] The collision between user icons means that the distance between the boundaries of the two user icons is less than a first preset distance. The collision between a user icon and a boundary of a target area means that the distance between the boundary of the user icon and a boundary of the target area is less than a second preset distance. The first preset distance and the second preset distance may be the same, or they may be different.
[0105] Exemplarily, a UICollisionBehavior (collision behavior) class can be created, and the attribute value of the translatesReferenceBoundsIntoBoundary attribute (i.e., the boundary attribute in the embodiment of the present invention) can be set to YES, that is, the boundary of the target view is used as the boundary of the target area that supports the collision behavior, that is, any area in the target view supports the collision behavior. In addition, the attribute value of the collisionMode attribute (i.e., the collision attribute in the embodiment of the present invention) can also be set to UICollisionBehaviorModeEverything, that is, it is set to support collision behaviors between user icons, and collision behaviors between user icons and the boundary of the target area.
[0106] Then, you can call the addBehavior (add behavior) method to add the collision behavior object and the gravity behavior object to the UIDynamicAnimator object, call the addItem (add item) method to add the object object to the collision behavior object and the gravity behavior object, and add the object object to the view object. Then, compile the source program of the social application to obtain the installation package of the social application.
[0107] In one embodiment of the present invention, Figure 4 Based on Figure 5 Before step S1061, the method may further include the following steps:
[0108] S109: Create a dynamic behavior class, set the attribute value of the elastic coefficient attribute and the attribute value of the friction coefficient attribute of the dynamic behavior class, and obtain a dynamic behavior object.
[0109] The attribute value of the elastic coefficient attribute represents the value of the change in the movement speed of the user icon after the collision occurs, and the movement direction relative to the movement direction before the collision occurs. The attribute value of the friction coefficient attribute represents the value of the reduction in the movement speed of the user icon when the user icon moves a preset number of pixels in the target view.
[0110] Accordingly, step S1061 may include the following steps:
[0111] S10611: Add the gravity behavior object, the collision behavior object and the dynamic behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object, the dynamic behavior object and the collision behavior object respectively to obtain the source program of the social application.
[0112] When a real object falls downward under the action of gravity, the speed of the real object will change due to the influence of friction (for example, the friction between the object and the air), and after the real object collides, the direction and speed of the real object's movement will change due to the influence of elastic force.
[0113] In order to more realistically simulate the motion state of a real object falling downward under the action of gravity, as well as the motion state of a real object after a collision, you can create a dynamic behavior class and set the attribute values of the elastic coefficient attribute and the friction coefficient attribute of the dynamic behavior class to obtain a dynamic behavior object.
[0114] Exemplarily, a UIDynamicItemBehavior (dynamic behavior) class may be created to set the property value of the elasticity property (ie, the elasticity coefficient property in the embodiment of the present invention) and the property value of the friction property (ie, the friction coefficient property in the embodiment of the present invention).
[0115] The dynamic behavior object is used to reduce the movement speed of the user icon by a preset value every time the user icon moves a preset number of pixels when the user icon moves in the target view. The preset number and preset value can be set by the technician based on experience. For example, the movement speed is reduced by 100 pixels / second every time the user icon moves a distance of 500 pixels.
[0116] The dynamic behavior object is also used to change the movement speed and direction of the user icon after the user icon has a collision behavior. For example, when the user icon has a collision behavior, the opposite direction of the movement direction of the user icon before the collision behavior can be used as the movement direction of the user icon after the collision behavior.
[0117] Alternatively, when the user icon collides with the boundary of the target area, the angle between the incident ray along the direction of movement of the user icon before the collision and the normal of the boundary of the target area is determined as the incident angle. According to the reflection principle, the reflection line corresponding to the incident ray can be determined, and the direction of the reflection line can be determined as the direction of movement of the user icon after the collision.
[0118] When a user icon (which may be called user icon 1) collides with another user icon (which may be called user icon 2), the angle between the incident line along the movement direction of user icon 1 before the collision and the normal line of the movement direction of user icon 2 before the collision can be determined as the incident angle, and the reflection line corresponding to the incident line can be determined according to the reflection principle, and the direction of the reflection line can be determined as the movement direction of user icon 1 after the collision. The method of adjusting the movement direction of user icon 2 is similar to the method of adjusting the movement direction of user icon 1.
[0119] In addition, after the user icon collides, the movement speed of the user icon may be reduced, for example, the movement speed of the user icon may be adjusted to three fifths, or one half, of the movement speed of the user icon before the collision.
[0120] Then, you can call the addBehavior (add behavior) method to add the collision behavior object, dynamic behavior object, and gravity behavior object to the UIDynamicAnimator object, call the addItem (add item) method to add the object object to the collision behavior object, dynamic behavior object, and gravity behavior object, and add the object object to the view object, and then compile the source program of the social application to obtain the installation package of the social application.
[0121] Based on the above processing, the motion state of the user icon in the target view can be adjusted according to the changes that occur when the motion state of the real object is affected by friction, and according to the changes that occur when the motion state of the real object is affected by elastic force after a collision, thereby enriching the display method of the matching page, increasing the fun of the matching interface, and improving the user experience.
[0122] and Figure 1 Corresponding to the method embodiment of Figure 6 , Figure 6 A structural diagram of an installation package generation device provided in an embodiment of the present invention, the device comprising:
[0123] A manager creation module 601 is used to create a physical behavior manager object;
[0124] A view creation module 602, used to create a view object of a target view for displaying a user icon, and add the physical behavior manager object to the view object;
[0125] A gravity behavior creation module 603 is used to create a gravity behavior class, and set the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein the attribute value of the direction attribute represents the movement speed of the user icon in the target view; and the attribute value of the angle attribute represents the movement direction of the user icon in the target view;
[0126] The object creation module 604 is used to create an object class and set the attribute value of the element attribute of the object class to obtain an object object; wherein the object object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view;
[0127] The coordinate manager creation module 605 is used to create a coordinate manager class and set the attribute value of the accelerometer attribute of the coordinate manager to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the time interval at which the accelerometer of the terminal obtains the acceleration of the terminal on each coordinate axis of the terminal coordinate system; the coordinate manager object is used to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculate the current gravity angle of the terminal based on each obtained acceleration, and assign the calculated gravity angle as the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
[0128] An adding module 606, used to add the gravity behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object to obtain a source program of a social application;
[0129] A compilation module 607 is used to compile the source program to obtain an installation package of the social application; wherein the social application is used to display the user icon in the target view using the direction represented by the current attribute value of the angle attribute as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position.
[0130] Optionally, the device further comprises:
[0131] A collision behavior creation module, used for creating a collision behavior class, setting the attribute value of the boundary attribute and the attribute value of the collision attribute of the collision behavior class, and obtaining a collision behavior object before the adding module 606 adds the gravity behavior object to the physical behavior manager object, adds the object object to the view object, and adds the object object to the gravity behavior object to obtain a source program of the social application; wherein the attribute value of the boundary attribute indicates the boundary of the target area in the target view that supports the collision behavior of the user icon; the attribute value of the collision attribute indicates whether the collision behavior between user icons is supported in the target area, and whether the collision behavior between the user icon and the boundary of the target area is supported;
[0132] The adding module 606 is specifically used to add the gravity behavior object and the collision behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object and the collision behavior object respectively to obtain the source program of the social application.
[0133] Optionally, the boundary of the target area in the target view that supports the collision of the user icons is the boundary of the target view; the target area supports collisions between user icons and collisions between user icons and the boundary of the target area.
[0134] Optionally, the device further comprises:
[0135] A dynamic behavior creation module, used for, before the adding module 606 executes adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object object to the view object, and respectively adding the object object to the gravity behavior object and the collision behavior object, and obtaining the source program of the social application, executing creation of a dynamic behavior class, setting the attribute value of the elasticity coefficient attribute and the attribute value of the friction coefficient attribute of the dynamic behavior class, and obtaining the dynamic behavior object; wherein the attribute value of the elasticity coefficient attribute represents the numerical value of the change in the movement speed of the user icon after the collision behavior occurs, and the movement direction relative to the movement direction before the collision behavior occurs; the attribute value of the friction coefficient attribute represents the numerical value of the reduction in the movement speed of the user icon when the user icon moves a preset number of pixels in the target view;
[0136] The adding module 606 is specifically used to add the gravity behavior object, the collision behavior object and the dynamic behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object, the dynamic behavior object and the collision behavior object respectively to obtain the source program of the social application.
[0137] Based on the installation package generation device provided by the embodiment of the present invention, a gravity behavior object and an object object are added to the view object of the target view of the social application. The social application can determine the current gravity angle of the terminal through the coordinate manager object, and assign it to the current attribute value of the angle attribute of the gravity behavior object. The attribute value of the angle attribute can represent the running direction of the user icon represented by the object object. Accordingly, the direction represented by the current gravity angle of the terminal can be used as the movement direction, and the movement speed represented by the attribute value of the direction attribute can be used as the initial movement speed to display the user icon in the target view. Since the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, the angle can represent the direction of the terminal relative to the ground, that is, when the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction changes, that is, when the direction of the terminal relative to the ground changes, the user icon can be displayed in the matching page of the social application according to the movement state of the real object under the action of gravity, which enriches the display mode of the matching page, increases the fun of the matching interface, and improves the user experience.
[0138] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0139] Memory 703, used for storing computer programs;
[0140] The processor 701 is used to execute the program stored in the memory 703 to implement the following steps:
[0141] Create a physics behavior manager object;
[0142] Creating a view object of a target view for displaying a user icon, and adding the physical behavior manager object to the view object;
[0143] Create a gravity behavior class, and set the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein the attribute value of the direction attribute represents the movement speed of the user icon in the target view; and the attribute value of the angle attribute represents the movement direction of the user icon in the target view;
[0144] Creating an object class, and setting the attribute value of the element attribute of the object class to obtain an object object; wherein the object object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the displayed content in the user icon, and the initial position of the user icon in the target view;
[0145] Create a coordinate manager class, and set the attribute value of the accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the time interval for the accelerometer of the terminal to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system; the coordinate manager object is used to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculate the current gravity angle of the terminal based on the obtained accelerations, and assign the calculated gravity angle to the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
[0146] Adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain a source program of a social application;
[0147] The source program is compiled to obtain an installation package of the social application; wherein the social application is used to display the user icon in the target view with the direction represented by the current attribute value of the angle attribute as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position.
[0148] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0149] The communication interface is used for communication between the above electronic device and other devices.
[0150] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0151] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0152] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned installation package generation methods are implemented.
[0153] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any of the installation package generation methods in the above embodiments.
[0154] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0155] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article 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, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0156] Each embodiment in this specification is described in a related 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 device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0157] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for generating an installation package, characterized in that: The method comprises: Create a physics behavior manager object; Creating a view object of a target view for displaying a user icon, and adding the physical behavior manager object to the view object; Create a gravity behavior class, and set the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein the attribute value of the direction attribute represents the movement speed of the user icon in the target view; and the attribute value of the angle attribute represents the movement direction of the user icon in the target view; Creating an object class, and setting the attribute value of the element attribute of the object class to obtain an object object; wherein the object object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the displayed content in the user icon, and the initial position of the user icon in the target view; Create a coordinate manager class, and set the attribute value of the accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the time interval at which the accelerometer of the terminal obtains the acceleration of the terminal on each coordinate axis of the terminal coordinate system; the coordinate manager object is used to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculate the current gravity angle of the terminal based on the obtained accelerations, assign the calculated gravity angle to the current attribute value of the angle attribute, so as to adjust the movement direction of the user icon in the target view based on the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, so that when the direction of the terminal relative to the ground changes, the user icon is displayed in the target view according to the downward falling movement state of the real object under the action of gravity; the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction; the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction represents the direction of the terminal relative to the ground; Adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain a source program of a social application; Compiling the source program to obtain an installation package of the social application; wherein the social application is used to display the user icon in the target view using the direction represented by the current attribute value of the angle attribute as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position; Before adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain the source program of the social application, the method further includes: Create a collision behavior class, set the attribute value of the boundary attribute and the attribute value of the collision attribute of the collision behavior class, and obtain a collision behavior object; wherein the attribute value of the boundary attribute represents the boundary of the target area in the target view that supports the collision behavior of the user icon; the attribute value of the collision attribute represents whether the collision behavior between user icons is supported in the target area, and whether the collision behavior between the user icon and the boundary of the target area is supported; The step of adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain a source program of a social application includes: Adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object and the collision behavior object respectively, to obtain a source program of a social application; Before adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object and the collision behavior object respectively to obtain the source program of the social application, the method further includes: A dynamic behavior class is created, and the attribute value of the elastic coefficient attribute and the attribute value of the friction coefficient attribute of the dynamic behavior class are set to obtain a dynamic behavior object; wherein the attribute value of the elastic coefficient attribute represents the numerical value of the change in the movement speed of the user icon after the collision behavior occurs, and the movement direction relative to the movement direction before the collision behavior occurs; the attribute value of the friction coefficient attribute represents the numerical value of the reduction in the movement speed of the user icon when the user icon moves a preset number of pixels in the target view; the dynamic behavior object is used to determine the angle between the incident ray along the movement direction of the user icon before the collision behavior occurs and the normal line of the boundary of the target area as the incident angle when the user icon collides with the boundary of the target area, determine the reflection line corresponding to the incident ray according to the reflection principle, and determine the direction of the reflection line as the movement direction of the user icon after the collision behavior occurs; The adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object and the collision behavior object respectively to obtain a source program of a social application, comprises: Add the gravity behavior object, the collision behavior object and the dynamic behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object, the dynamic behavior object and the collision behavior object respectively to obtain the source program of the social application.
2. The method according to claim 1, characterized in that The boundary of the target area in the target view that supports the collision of the user icons is the boundary of the target view; the target area supports collisions between user icons and between user icons and the boundary of the target area.
3. An installation package generating device, characterized in that: The device comprises: Manager creation module, used to create physical behavior manager objects; A view creation module, used to create a view object of a target view for displaying a user icon, and add the physical behavior manager object to the view object; A gravity behavior creation module, used to create a gravity behavior class, and set the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein the attribute value of the direction attribute represents the movement speed of the user icon in the target view; the attribute value of the angle attribute represents the movement direction of the user icon in the target view; An object creation module, used to create an object class, and set the attribute value of the element attribute of the object class to obtain an object object; wherein the object object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view; A coordinate manager creation module, used to create a coordinate manager class, and set the attribute value of the accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the time interval at which the accelerometer of the terminal obtains the acceleration of the terminal on each coordinate axis of the terminal coordinate system; the coordinate manager object is used to obtain the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculate the current gravity angle of the terminal based on the obtained accelerations, assign the calculated gravity angle to the current attribute value of the angle attribute, so as to adjust the movement direction of the user icon in the target view based on the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, so that when the direction of the terminal relative to the ground changes, the user icon is displayed in the target view according to the downward falling movement state of the real object under the action of gravity; the current gravity angle of the terminal represents the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction; the current angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction represents the direction of the terminal relative to the ground; An adding module, used to add the gravity behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object to obtain a source program of a social application; a compiling module, used to compile the source program to obtain an installation package of the social application; wherein the social application is used to display the user icon in the target view using the direction represented by the current attribute value of the angle attribute as the movement direction, the movement speed represented by the attribute value of the direction attribute as the initial movement speed, and the position represented by the attribute value of the element attribute as the initial position; The device also includes: A collision behavior creation module, used for creating a collision behavior class, setting the attribute value of the boundary attribute and the attribute value of the collision attribute of the collision behavior class, and obtaining a collision behavior object before the adding module executes adding the gravity behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object to obtain a source program of the social application; wherein the attribute value of the boundary attribute represents the boundary of the target area in the target view that supports the collision behavior of the user icon; the attribute value of the collision attribute represents whether the collision behavior between user icons is supported in the target area, and whether the collision behavior between the user icon and the boundary of the target area is supported; The adding module is specifically used to add the gravity behavior object and the collision behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object and the collision behavior object respectively, to obtain the source program of the social application; The device also includes: A dynamic behavior creation module, used for, before the adding module executes adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object object to the view object, and adding the object object to the gravity behavior object and the collision behavior object respectively, and obtaining the source program of the social application, executing the creation of a dynamic behavior class, setting the attribute value of the elastic coefficient attribute and the attribute value of the friction coefficient attribute of the dynamic behavior class, and obtaining a dynamic behavior object; wherein the attribute value of the elastic coefficient attribute represents the numerical value of the change in the movement speed of the user icon after the collision behavior occurs, and the movement direction relative to the movement direction before the collision behavior occurs; the attribute value of the friction coefficient attribute represents the numerical value of the movement speed of the user icon when the user icon moves a preset number of pixels in the target view; the dynamic behavior object is used to determine the angle between the incident line along the movement direction of the user icon before the collision behavior occurs and the normal line of the boundary of the target area as the incident angle, determine the reflection line corresponding to the incident line according to the reflection principle, and determine the direction of the reflection line as the movement direction of the user icon after the collision behavior occurs; The adding module is specifically used to add the gravity behavior object, the collision behavior object and the dynamic behavior object to the physical behavior manager object, add the object object to the view object, and add the object object to the gravity behavior object, the dynamic behavior object and the collision behavior object respectively to obtain the source program of the social application.
4. The device according to claim 3, characterized in that The boundary of the target area in the target view that supports the collision of the user icons is the boundary of the target view; the target area supports collisions between user icons and between user icons and the boundary of the target area.
5. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1-2 when executing a program stored in a memory.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1-2 are implemented.