Jump to content

Game states and variables


barilo
 Share

Recommended Posts

Hello,

I'm trying to make a game with different states :
The first one is the main state (Play.js) where the game is running and I have a second state (Skills.js) to create a Skills Tree.
To keep track of my variables I store the data into two JSON file and I pass them when I'm changing state like that :

Play => Skills

this.game.state.start('Skills', true, false, JSON.stringify(this.gameObject), JSON.stringify(this.skillsObject));

Skills => Play

this.game.state.start('Play', true, false, JSON.stringify(this.gameObject), JSON.stringify(this.skillsObject));

 

However, I have a timer which displays the remaining time and a menu bar in Play.js and I would like to keep displaying them in Skills.js.

I made some research and I could turn the "clearWorld" parameter to false but this will keep displaying the others spritesheets and I won't want that.
So,  how could I do that ?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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