Sign in to follow this  
MackTuesday

Multiple game states with common UI

Recommended Posts

The game I'm working on has the screen divided into a few frames. The contents of the frames can change depending on game state, but the layout -- borders, border art, frame sizes and positions -- always stays the same.

If I have a global layout building function that all states share, is that an acceptable design? Is there a better way?

Share this post


Link to post
Share on other sites

Thanks. So for example I would add a sprite to the stage instead of the world with

var whatever = game.add.sprite(x, y, 'whateverKey', null, game.stage);

right? Or should the frame be 0 instead of null? The code seems to indicate either will work, but I might have misinterpreted what I saw in the listings.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.