datvm Posted August 27, 2015 Share Posted August 27, 2015 Recently I need to update a HTML element from the game each frame. The box element itself is seperated, and my game use States. I also realize if I use State, the update method of the Game is never called. Is there any "global" update that I can use, no matter which State I am using? Link to comment Share on other sites More sharing options...
rich Posted August 27, 2015 Share Posted August 27, 2015 Phaser always has at least 1 State running, and if present it will call the update method of that state. If you break your game up into multiple states only one of those can be active at any one time - and only that states update method will be called. So if you have important stuff going on in another state, then change state, it will stop firing - so you need to restructure your code to deal with this. Link to comment Share on other sites More sharing options...
Recommended Posts