brianautumn Posted August 14, 2015 Share Posted August 14, 2015 Hey everyone, probably noob question, but I wanted to know what the best and safest practice for keeping global variables across states. Should I declare them as actual global variables, or as parameters of the game object?var game = new Phaser.Game(960, 540, Phaser.AUTO, 'game');var score = 0;var level = 0;//or something like thisgame.score = 0;Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts