Method for improving game code reusability, terminal device and storage medium
A reusability and game technology, applied in the fields of improving the reusability of game codes, servers and storage media, and methods, can solve problems such as poor reusability of game codes, improve portability and reusability, and improve work efficiency , the effect of reducing workload
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0025] see figure 1 , a schematic flowchart of a method for improving game code reusability provided by an embodiment of the present invention, including the following steps:
[0026] Step S101, defining a structure, which contains the property values and callback functions of the game object;
[0027] The structure is a collection of the same or different types of data. Data that needs to be used to complete a specific step can be added to the structure. The data can include constants, function variables, and executed functions. In the embodiment of the present invention The structure contains the data that needs to be used when the attribute value of the game object changes. For example, when the game object is a character, when the character is injured, the life value will be reduced. After the life value is reduced, the blood volume may turn red, move Slow down, etc., specifically include attribute values, callback functions, and optionally, change functions for judging...
Embodiment 2
[0036] exist figure 1 on the basis of combining figure 2 Step S102 in detail: set the enumeration of game object attributes in the game, and set the key-value correspondence between the object attribute and the attribute value each time an object is created, as follows:
[0037] After defining the structure, through S1021, enumerate all the properties contained in the game object. For example, you can define a function as PlayerProperty, which contains object properties, and add the keyword enum to enumerate. Attributes are attribute variables created when an object is created.
[0038] In S1022, each time a game object is created, a structure map variable is created for each object, and the map variable uses the value of the property enumeration game object PlayerProperty as the key, and the value of the property in the corresponding structure as value. The map is an associative container, which can perform one-to-one data processing, and attributes can be associated with ...
Embodiment 3
[0043]The above mainly describes a method for improving game code reusability, and a terminal device for improving game code reusability will be described in detail below.
[0044] image 3 It shows a schematic structural diagram of a terminal device that improves game code reusability, including:
[0045] Definition module 310: used to define a structure, which contains property values and callback functions of game objects;
[0046] Optionally, the structure further includes a change function for judging whether the attribute value changes.
[0047] Setting module 320: used to set the enumeration of the game object attribute, and set the key-value correspondence between the object attribute and the attribute value each time the game object is created.
[0048] Optionally, the setting module 320 includes:
[0049] Enumeration unit: an enumeration used to set the attributes of the game object;
[0050] Setting unit: when used for a game object, define a map variable for ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com