type TMuggleObject = class(
TMuggleBaseObject
)
Every game object is a MuggleObject. The MuggleManager stores and manages all of these objects: creation, deletion, etc.
The Create and Destroy methods should never be used for Game-related stuff.
This is because the engine will create "dummy" copies of the objects.
There are OnBirth and OnDelete methods for Game-related code.
The BuildVisuals and ReleaseVisuals are for introducing GLScene visuals.
The UpdateVisuals method is for updating your GLScene visuals.
The Initialize method is for one-time class-wide code such as building the FreeForm for a proxy object.
The OnCollide and OnDamage methods are game event functions.
TMuggleBaseObject
procedure BuildVisuals; virtual; |
|
procedure Cease; |
|
Constructor Create; override; |
|
Destructor Destroy; override; |
|
procedure FullDisplay(aList: TStrings); override; |
|
function GetPrimaryVisual: TGLBaseSceneObject; virtual; |
|
procedure Initialize; virtual; |
|
class function IsStatic: boolean; virtual; |
|
procedure OnBirth; virtual; |
|
procedure OnCollide(aCollider: TMuggleObject); virtual; |
|
procedure OnDelete; virtual; |
|
function OneLineDisplay: string; override; |
|
procedure ReleaseVisuals; virtual; |
|
procedure Step; virtual; |
|
procedure UpdateVisuals; virtual; |
procedure BuildVisuals; virtual; |
build visuals
procedure Cease; |
Stop existing, and queue on Trash list
Constructor Create; override; |
Destructor Destroy; override; |
procedure FullDisplay(aList: TStrings); override; |
many lines of text to describe this object's state
function GetPrimaryVisual: TGLBaseSceneObject; virtual; |
This function returns Visuals.Items[0] by default, can be overridden
procedure Initialize; virtual; |
call initialize only once per class (when first object of class is created)
class function IsStatic: boolean; virtual; |
is this object static? (static = doesnt move in the game world)
procedure OnBirth; virtual; |
called once when born
procedure OnCollide(aCollider: TMuggleObject); virtual; |
called when colliding with another object
procedure OnDelete; virtual; |
called once when deleted
function OneLineDisplay: string; override; |
one line of text to describe this object's state
procedure ReleaseVisuals; virtual; |
free visuals
procedure Step; virtual; |
Run management/ai code
procedure UpdateVisuals; virtual; |
update visuals
property Age: integer; |
|
property Birthday: integer; |
|
property Definition: TMuggleDefinition; |
|
property Exists: boolean; |
|
property PrimaryVisual: TGLBaseSceneObject; |
|
property Visuals: TMuggleBaseContainer; |
|
property VisualsShared: TMuggleReferenceList; |
property Age: integer; |
Age in clock ticks
property Birthday: integer; |
Time of birth
property Definition: TMuggleDefinition; |
The shared Definition among this object class
property Exists: boolean; |
Exists in the game? If not, its gonna be deleted.
property PrimaryVisual: TGLBaseSceneObject; |
primary visual (returns Visuals.Items[0] by default)
property Visuals: TMuggleBaseContainer; |
a list of all owned visuals (owned)
property VisualsShared: TMuggleReferenceList; |
a list of all shared visuals (not owned)