Jump to content

Global Parameters / Variables


Recommended Posts

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;


Link to comment
Share on other sites


  • Recently Browsing   0 members

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