Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State interface { // Executed when the state begins OnStart(world w.World) // Executed when the state exits OnStop(world w.World) // Executed when a new state is pushed over this one OnPause(world w.World) // Executed when the state become active again (states pushed over this one have been popped) OnResume(world w.World) // Executed on every frame when the state is active Update(world w.World, screen *ebiten.Image) Transition }
State is a game state
type StateMachine ¶
type StateMachine struct {
// contains filtered or unexported fields
}
StateMachine contains a stack of states. Only the top state is active.
type TransType ¶
type TransType int
TransType is a transition type
const ( // TransNone does nothing TransNone TransType = iota // TransPop removes the active state and resume the next state TransPop // TransPush pauses the active state and add new states to the stack TransPush // TransSwitch removes the active state and replace it by a new one TransSwitch // TransReplace removes all states and insert a new stack TransReplace // TransQuit removes all states and quit TransQuit )
type Transition ¶
Transition is a state transition
Click to show internal directories.
Click to hide internal directories.