Jump to content

Restarting a Phaser State is Resetting Global Variables


Wunderforce
 Share

Recommended Posts

I have a global object called "params" that stores a lot of important parameters for my game.  I define params in a "main.js" file that initializes the game, defines my states and parameters, and then calls my "bootState". 

For some reason, when I restart my "gameState" (another state, defined in "gameState.js") it resets my "params" object to the values it was initialized with in "main.js".

My goal is to change some parameters via "params" in the console, then restart "gameState" and have it reflect those changed parameters.

If needed I can provide some example code.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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