1 decade ago by Jerczu
Its actually very simple to define it.
In your main js go just before your line initiating canvas here's a snippet from one of my games.
And then during game you can access any of these - so if you add to score in your game class each time you die do gameScore = scoreFromYourMainGameClass.
Then in any other ig.Class instance print it calling gameScore.
Simple.
In your main js go just before your line initiating canvas here's a snippet from one of my games.
var gameScore = 0; ig.main( '#canvas', MyGame, 60, 480, 320, 1 );
And then during game you can access any of these - so if you add to score in your game class each time you die do gameScore = scoreFromYourMainGameClass.
Then in any other ig.Class instance print it calling gameScore.
Simple.