Update: CC - Entity Loaded - Moorcow (nuqb3rb3y5.js) 588 bytes modified

beta.r3js.org
-=yb4f310 2017-11-24 13:32:23 +01:00
parent e6db2003f9
commit e45783651c
1 changed files with 3 additions and 28 deletions

View File

@ -82,9 +82,11 @@ GameLib.Event.Subscribe(
* Tell all our custom code components that we loaded
*/
GameLib.Event.Subscribe(
GameLib.Event.GAME_START,
GameLib.Event.CUSTOM_GAME_START,
function() {
delete this.beforeRender.initialized;
this.beforeRender.entityLoaded = this;
this.mouseUp.entityLoaded = this;
this.mouseDown.entityLoaded = this;
@ -110,33 +112,6 @@ GameLib.Event.Subscribe(
}.bind(this)
);
GameLib.Event.Subscribe(
GameLib.Event.GAME_RESTART,
function() {
console.log('restarting game');
GameLib.Event.Emit(GameLib.Event.GAME_OVER);
delete this.beforeRender.initialized;
GameLib.Event.Emit(GameLib.Event.GAME_START);
}.bind(this)
);
GameLib.Event.Subscribe(
GameLib.Event.GAME_OVER,
function() {
this.beforeRender.entityLoaded = null;
this.mouseUp.entityLoaded = null;
this.mouseDown.entityLoaded = null;
this.mouseMove.entityLoaded = null;
this.touchMove.entityLoaded = null;
GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO);
}.bind(this)
);
//GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
/**
* Plant all our trees - Below code gets generated automatically
*/