Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

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

Inactive Publication Date: 2018-09-28
WUHAN DOUYU NETWORK TECH CO LTD
View PDF4 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In view of this, the embodiment of the present invention provides a method for improving game code reusability, a terminal device and a storage medium to solve the problem of poor game code reusability

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for improving game code reusability, terminal device and storage medium
  • Method for improving game code reusability, terminal device and storage medium
  • Method for improving game code reusability, terminal device and storage medium

Examples

Experimental program
Comparison scheme
Effect test

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 ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for improving game code reusability, a terminal device and a storage medium, and is suitable for game software development. The method provided by the invention comprises the following steps that: defining a structural body, wherein the structural body contains the attribute value and the callback function of a game object setting the enumeration of a game object attribute, and setting a key value corresponding relationship of the game object attribute and the attribute value during the creation of the game object each time; and when the same type of game is developed, changing the enumeration and the callback function of the game object attribute. By use of the method, the structural object is defined to carry out enumeration on the game object attribute so as to establish the key value corresponding relationship of the attribute and the attribute value. When new game is developed, only the attribute of the enumeration and the call function need to bechanged, the portability and the reusability of codes can be improved, in addition, a workload can be reduced, and working efficiency is improved.

Description

technical field [0001] The invention relates to the field of software development, in particular to a method for improving game code reusability, a server and a storage medium. Background technique [0002] With the popularity of mobile phones and computers, games have become a way of mass entertainment. Sandbox games are loved by many players due to their strong interaction and high degree of freedom. However, due to the many elements involved in the sandbox game and the complex composition, the development is difficult and the amount of code is very large. [0003] At present, the development of new games requires all the codes to be rewritten, but most of the sandbox games are similar in type, and the character attributes are changed, correspondingly displaying different UI interfaces and different operation behaviors, such as being injured, the blood volume is reduced, and the corresponding blood volume is displayed in red. This part of the effect They are all similar. ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/36G06F8/72
CPCG06F8/36G06F8/72
Inventor 时学凯张文明陈少杰
Owner WUHAN DOUYU NETWORK TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products