GOOC - Game Oriented Object C

GOOC - Game Oriented Object C

Next: Event System, Previous: Animations, Up: Top
[Contents]

13. Defining Your GOOL Object

13. Defining Your GOOL Object

In order to even have a functional GOOL object at all, you must first define some basic GOOL parameters for it. These are simply the GOOL EID, the GOOL ID, and the category. This is done using the equally simple #gool directive: #gool gool-eid gool-id gool-category gool-eid is a 5-character name using only valid ename characters (which MUST end in the character C), gool-id is a valid GOOL ID (from 0 to 63 in Crash 1 and Crash 2, and 0 to 127 in Crash 3), and gool-category is the object's category, which determines a handful of specific behaviors and is used in a few GOOL instructions.

Keep in mind that, even though you're defining only one "GOOL object", you can include multiple types of objects within it. For example, RWaOC in Crash 1 contains code for the slide platforms, pushers, bats and iguana enemies, PartC in Crash 2 contains code for particles, elevators, the audio streamer. Although you can define multiple unique objects in just one GOOL file, some things such as the object category and event interrupt table are shared by every object in it, so a bit of care must be taken. The slide platforms and pushers cannot be spun away despite the spin event being mapped to the interrupt table due to their state flags, for example.

While not mandatory, by convention this is the first line of a gooc source code file.