From 1f0362ba627f19f8a346785359ad0b8621e1c179 Mon Sep 17 00:00:00 2001 From: -=ybafelo Date: Thu, 24 May 2018 14:16:53 +0200 Subject: [PATCH] game-start events --- ff0fsum4zx.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/ff0fsum4zx.js b/ff0fsum4zx.js index c590fe5..3fa4a5d 100644 --- a/ff0fsum4zx.js +++ b/ff0fsum4zx.js @@ -394,15 +394,25 @@ R3.CustomCode.prototype.move = function(data) { this.footballPlayer.instance.translateY(this.playerY); this.football.instance.position.y = this.ballY; -this.mouseMove.entityLoaded = this; -this.touchMove.entityLoaded = this; -this.beforeRender.entityLoaded = this; -R3.Event.Emit( - R3.Event.PLAY_AUDIO, - { - name : 'Audio - Crowd' + +R3.Event.Subscribe( + R3.Event.GAME_START, + function() { + + R3.Event.Emit( + R3.Event.PLAY_AUDIO, + { + name : 'Audio - Crowd' + } + ); + + this.mouseMove.entityLoaded = this; + this.touchMove.entityLoaded = this; + this.beforeRender.entityLoaded = this; } ); +R3.Event.Emit(R3.Event.GAME_LOADED); + //@ sourceURL=entityLoaded.js