Pass game instance as boot callback arguments.

It may be useful to run some operations while the game is booting.
However, if a living instance of the game is necessary during this
process, only way possible is using a global variable at the moment.

This commit aims to amend that so whenever needed the game instance
reference is passed down and can be used inside the {pre,post}Boot
callbacks.
This commit is contained in:
Rafael Barbosa Lopes 2018-03-05 13:09:12 -03:00
parent 6e82760c99
commit 20e3825e1f

View file

@ -265,7 +265,7 @@ var Game = new Class({
{ {
this.isBooted = true; this.isBooted = true;
this.config.preBoot(); this.config.preBoot(this);
CreateRenderer(this); CreateRenderer(this);
@ -292,7 +292,7 @@ var Game = new Class({
{ {
this.isRunning = true; this.isRunning = true;
this.config.postBoot(); this.config.postBoot(this);
if (this.renderer) if (this.renderer)
{ {