isfuturebright

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

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.