Update: CC - Entity Loaded - Moorcow (nuqb3rb3y5.js) 588 bytes modified
parent
e6db2003f9
commit
e45783651c
|
@ -82,9 +82,11 @@ GameLib.Event.Subscribe(
|
||||||
* Tell all our custom code components that we loaded
|
* Tell all our custom code components that we loaded
|
||||||
*/
|
*/
|
||||||
GameLib.Event.Subscribe(
|
GameLib.Event.Subscribe(
|
||||||
GameLib.Event.GAME_START,
|
GameLib.Event.CUSTOM_GAME_START,
|
||||||
function() {
|
function() {
|
||||||
|
|
||||||
|
delete this.beforeRender.initialized;
|
||||||
|
|
||||||
this.beforeRender.entityLoaded = this;
|
this.beforeRender.entityLoaded = this;
|
||||||
this.mouseUp.entityLoaded = this;
|
this.mouseUp.entityLoaded = this;
|
||||||
this.mouseDown.entityLoaded = this;
|
this.mouseDown.entityLoaded = this;
|
||||||
|
@ -110,33 +112,6 @@ GameLib.Event.Subscribe(
|
||||||
}.bind(this)
|
}.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
|
* Plant all our trees - Below code gets generated automatically
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue