From bfcbfd04ab2d04a3058efc21812b2c19d97962d4 Mon Sep 17 00:00:00 2001 From: Theunis Johannes Botha Date: Sun, 20 May 2018 23:56:17 +0200 Subject: [PATCH] Update: CC - Entity Loaded - AR Football 3 (ff0fsum4zx.js) 642 bytes modified --- ff0fsum4zx.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/ff0fsum4zx.js b/ff0fsum4zx.js index b00dd38..817fee2 100644 --- a/ff0fsum4zx.js +++ b/ff0fsum4zx.js @@ -120,6 +120,12 @@ R3.CustomCode.prototype.render = function(delta) { console.log('left goal!'); ball.scored = true; ball.scoredThroughGoal = 'left'; + R3.Event.Emit( + R3.Event.PLAY_AUDIO, + { + name : 'Audio - Crowd Cheer' + } + ); } } @@ -128,11 +134,15 @@ R3.CustomCode.prototype.render = function(delta) { console.log('right goal!'); ball.scored = true; ball.scoredThroughGoal = 'right'; + R3.Event.Emit( + R3.Event.PLAY_AUDIO, + { + name : 'Audio - Crowd Cheer' + } + ); } } - - /** * Check for goal reflection */ @@ -316,6 +326,13 @@ R3.CustomCode.prototype.move = function(data) { return; } + R3.Event.Emit( + R3.Event.PLAY_AUDIO, + { + name : 'Audio - Kick' + } + ); + var kickDuration = Date.now() - this.startTime; var speed = this.kickDistance / kickDuration * 20; @@ -378,5 +395,11 @@ this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; this.beforeRender.entityLoaded = this; +R3.Event.Emit( + R3.Event.PLAY_AUDIO, + { + name : 'Audio - Crowd' + } +); //@ sourceURL=entityLoaded.js \ No newline at end of file