You write the state definition to specify what a state actually does and how it's made up. A state definition consists of information regarding the state’s name and the body of the state. The state body is a series of state statements enclosed in braces:
state state-name {
...
}
Although not technically mandatory, a state cannot function if it does not have a
Each of the three blocks in a state can be defined in-line within the state (state subroutine), or through the lambda operator sub MySub () {
do {
playanim(0, 0)
} while (1)
}
state FirstState {
code => sub MySub // set the code block to the subroutine MySub
trans {
x += 1.0
}
}
state SecondState {
code => state FirstState // the code block used will be the same as FirstState's
trans => state FirstState // the trans block used will be the same as FirstState's
}
This allow quick and easy re-use of code and state functionality.