Closed jessefreeman closed 11 years ago
States are allowed to have a public game property because they are never used WITHIN the Game framework, i.e. they are not objects that belong to Phaser. They are a list of short-cuts and proxy methods to make coding (on the game side) less verbose, I guess think of them as being stripped down versions of Phaser.Game.
State could technically use a getter to _game instead, but it doesn't help consistency because it's still exposed as a public game property.
Every other class uses a private _game.
There are 2 inconsistent ways to get reference to the game instance depending on what class you are in. Game Objects have a private variable _game while states have game. This should be the same throughout the Framework. I suggest using a game getter/setter to clean things up in the Basic class
Plus this is a TS issue since technically you shouldn't be able to access private vars when extending a class so it would be best to shy developers away from directly accessing anything with an underscore.