Menu

Game Objects

g-dollar

Game Objects (hereafter GO) are the components of AGE that are domain objects of the game being built. AGE provides an abstract base class for GOs, and several implementations for commonly-used object "types".

Game Objects

Every GO has a name that must be unique across all installed GOs. There is a helper method to generate "fresh" names for "anonymous" GOs.

Names are important because they are used by the Locator interface to provide matching GOs during update callbacks (e.g. timer update message).

Every GO has a locatable flag that indicates whether it participates in the Locator. This allows for transient GOs that should not be stored for later reference.

Properties

GO data values are called properties and they are indirectly represented through this interface, instead of relying on Java inheritance. This makes GO classes usable with less subclassing.

Properties are represented as a map, with integer keys, and reference type values. This means that primitive values like int and float must use the boxed equivalent, Integer and Float instead. Avoid auto-boxing to prevent excessive object creation, and use the valueOf() methods exclusively, because these utilize caching.

Game Object Classes

Since property values are treated indirectly, GO classes are usable without further subclassing. For example, DrawableGameObject can directly represent anything with Geometry and Material attached to it.

GameObject

Abstract base class for all GOs.

GameObjectCollection < T >

Generic base class for a GO that contains a collection of other GOs. Add to the collection with Install Pipeline and bind the name of the collection. Remove from collection with Uninstall pipeline.

GameObjectWithProperties

Base class for GOs that are non-visual and have properties.

DrawableGameObject

Subclass of GameObjectWithProperties. Base class for GOs that render and have properties. Requires an instance of Geometry to render.

Scene

Base class for a GO collection displayed by the RenderService. You cannot directly add to the Scene; use the Install Pipeline and bind the name of the Scene.

Transition

Subclass of Scene. Base class for visual effects applied to one-or-more Scenes.

SceneInstallSentinel

GO used to indicate the end of an install sequence for the given Scene. This GO is used to start the scene.


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.