GOOC - Game Oriented Object C
GOOC - Game Oriented Object C
10.2. The code Block
10.2. The code Block
The code block is the main block of functionality for a state. The code block functions like a normal subroutine would, but is temporarily suspended by specific graphics instructions (the ones that play graphics), and if it returns, the object is killed. Once the code block thread is suspended, the game proceeds to do all physics calculations, collision, rendering, etc. and the thread on the block resumes after a specified time.
A code block has a list of parameters, which are passed when the object is spawned, or changes state (Crash 2 onwards).
A code block is defined like this:
code pre-modifiers (parameter-list)
{
subroutine-body
}
Note that pre-subroutine modifiers are the only type of modifiers that can be used.