Sunday, March 31, 2013

Refactoring, Part #2

After some consideration and research, the primary classes can be written using a standard model.  It does require a few additional lines; however, that is a minor issue.  Of the classes that need to be developed, there are two classes that are inherent to all objects ranging from asteroids to capital ships.  These are the classes designed to hold the player's data and vehicle's, or object's, data. 

Player data is primarily non-numeric data used to identify an object.  This includes the object's faction, name and type vehicle.  In previous prototypes, this data grouping existed inside the battlestar.dll file and in the Unity game engine script files.  The resource manager acted as a go between to convert the battlestar.dll structure into a usable Unity data structure.  In this prototype, the player data will be attached directly into the flight control script, a relatively common script attached to most objects in the game. 

On the other hand, vehicle data is primarily numeric data used to define the vehicle or object.  It includes the object's structural integrity (damage capacity), turn speed and thrusting speed.  Like the player data, this data grouping existed in the battlestar.dll file and the Unity script files and will be integrated directly into the flight control script. 

In my next blog, I will define the player data class in more detail.  The goal will be to establish guidelines, for documentation purposes, that will guide in the construction of future scripts. 

No comments:

Post a Comment