BBMOD_StateMachine

Extends BBMOD_Class

constructor

new BBMOD_StateMachine()

Description

A state machine.

Properties

Name Description
Finished If true then the state machine has reached its final state.
OnEnter A function executed on the start of the state of the state machine. It should take the state machine as the first argument. Default value is undefined.
OnExit A function executed on the end of the state machine. It should take the state machine as the first argument. Default value is undefined.
OnPostUpdate A function executed in the update method after the current state is updated. It should take the state machine as the first argument and delta time as the second argument. Default value is undefined.
OnPreUpdate A function executed in the update method before the current state is updated. It should take the state machine as the first argument and delta time as the second argument. Default value is undefined.
OnStateChange A function executed when the state changes. It should take the state machine as the first argument and its previous state as the second argument. Default value is undefined.
Started If false then the state machine has not yet entered its initial state.
State The current state or undefined.

Methods

Name Description
add_state Adds a state to the state machine.
change_state Changes the state of the state machine and executes BBMOD_StateMachine.OnStateChange.
finish Enters the exit state of the state machine.
start Enters the initial state of the state machine.
update Executes function for the current state of the state machine (if defined).

See also

BBMOD_State

Do you find this page helpful?

Copyright © 2022, BlueBurn. Built on November 16, 2022 using GMDoc.