Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Global Parameters / Variables


brianautumn
 Share

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;

Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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