One thing that's made adding new features really easy in Phaser is using finite-state machines to model behaviour.
In this article, Michael Kelly creates a state class in his project, to model the player's behaviour by assigning them a single "state" to be in.
When the player is in a "state", they can "transition" to another state if a condition is met, which replaces the current state with a new one.
Almost every player animation transition can be backed by a state machine.
If you wish to post comments on our site, you'll need an account. Please login or register.
Login Register