Jump to content

Multiple game states with common UI


MackTuesday
 Share

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?

Link to comment
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.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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