What is a State Machine?

State Machines

A state machine allows us as a developer to take a complex task and simplify it down by using the state of an instance.

 

For example if we take a look at this treasure chest, we can see it might have four different states.

Treasure Chest States

Idle

Opening

Opened

Closing

deck

By gamemakercasts

deck

  • 52