-
Notifications
You must be signed in to change notification settings - Fork 2
Home
A state that can be added to a StateMachine.
A finite state machine.
The event that gets called when StateMachine enters the current state.
The event that gets called when StateMachine leaves the current state.
The event that gets called when the "update" method of the StateMachine is called.
Adds a state to the finite state machine.
Param | Type | Description |
---|---|---|
index | mixed | The unique index variable used to keep track of the state. Using enums is recommended, but you can also use strings if you really want to. |
state | struct | The state to be added. |
Removes a state from the finite state machine.
Param | Type | Description |
---|---|---|
index | mixed | Index of the state that's going to be removed. |
Changes the current state of StateMachine to the provided index.
Param | Type | Description |
---|---|---|
index | mixed | Index of the state that's going to be set as the new one. |
Changes the current state of the current StateMachine to the next one.
Works similarly to "change(index)" but it will "change" to the state that is already running, essentially resetting the current state.
Returns the current state index of the current StateMachine.
Returns: The current state index of the current StateMachine.
Returns the number of states within the current StateMachine.
Returns: The number of states within the current StateMachine.
Returns the number of frames that have passed since the State has been initialized.
Returns: The number of frames that have passed since the State has been initialized.
Clears all the states from the current StateMachine.
Destroys the current StateMachine to free the memory.
Executes the "update" event of the current State.
Executes a specific event of the current State.
Param | Type | Description |
---|---|---|
event_name | string | Name of the event to execute. |