Wunderforce Posted February 14, 2018 Share Posted February 14, 2018 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 More sharing options...
casey Posted February 14, 2018 Share Posted February 14, 2018 Are you re-declaring or initializing your variable in gameState? So if you had a var score; in main.js, are you initializing it as score =0; or var score =0; in your gameState? Link to comment Share on other sites More sharing options...
Wunderforce Posted February 14, 2018 Author Share Posted February 14, 2018 DOH! I actually am for the parameter in question. I accidentally used a "=" instead of a "==" in a statement. Boy do I feel stupid.... Should I delete this topic/thread? Link to comment Share on other sites More sharing options...
casey Posted February 14, 2018 Share Posted February 14, 2018 Personally I prefer old threads stay up so people with the same problem can read them and figure out where they're going wrong. They fall down the list pretty quickly so will be buried before you know it Link to comment Share on other sites More sharing options...
Recommended Posts