Jump to content

Is there any way to put a state on top of another?


isfuturebright
 Share

Recommended Posts

The way I am handling this for my current game is not, really how I'm sure phase is meant to be used however it is the only way to achieve this for now.

I only use a single "real" phaser state, which acts as my StateMachine. The state machine allows a previous state to exist, and can pop back to it.

Every state has an onEnter onUpdate, onExit and destroy method. onUpdate is only called on the currentState and destroy is called once a say a third state is pushed the first one will be destroyed and the second will become previousState

This works quiet well, and I have experienced no issues with this paradigm existing on top of phaser.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...