Creating a GameObject

Coordinator
Jul 8, 2008 at 8:09 PM
Edited Jul 8, 2008 at 8:22 PM

From DarkWynter Wiki



GameObject Abstraction

 The GameObject class provides all functionality required by a 3D world object in our engine.
This base level of functionality is extended by overriding GameObject.
GameObject is used by ObjectLibrary, Renderer, and Collision as an abstract handle for all 3D world objects.

Pre-defined GameObjects

 Current Game defined GameObject overrides are:
Human (extends Player)
AI (extends Player)
Portal (door object)
Skysphere
 Current Engine defined GameObject overrides are:
Terrain
Player
Bullet
Particle

How to override GameObject

 0) - Add a new file to the Game layer project.  
1) - Override GameObject (eg - public class MyObject : GameObject )
2) - Add your GameObject to the Xml layer by copying the <GameObject> definition and modifying it's fields.
3) - Add your GameObject's Type declaration and Xml name property to UserDefinedTypes.cs.

Extending GameObject

 GameObject is  an abstract, generic, three-dimensional object used by ObjectLibrary.
It provides standard data-types and allows overriding of the following methods:

Load()
Update()
Draw()
ObjectCollisionResponse()
TerrainCollisionResponse()

The user-defined GameObject may choose which methods it wishes to override.
In each overridden method, functionality can be supplamented by calling base.Method(), or replaced by not calling base.Method().