Update: CC - Entity Loaded - AR Football 3 (ff0fsum4zx.js) 642 bytes modified

beta.r3js.org
Theunis Johannes Botha 2018-05-20 23:56:17 +02:00
parent b9d3aa497e
commit bfcbfd04ab
1 changed files with 25 additions and 2 deletions

View File

@ -120,6 +120,12 @@ R3.CustomCode.prototype.render = function(delta) {
console.log('left goal!'); console.log('left goal!');
ball.scored = true; ball.scored = true;
ball.scoredThroughGoal = 'left'; 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!'); console.log('right goal!');
ball.scored = true; ball.scored = true;
ball.scoredThroughGoal = 'right'; ball.scoredThroughGoal = 'right';
R3.Event.Emit(
R3.Event.PLAY_AUDIO,
{
name : 'Audio - Crowd Cheer'
}
);
} }
} }
/** /**
* Check for goal reflection * Check for goal reflection
*/ */
@ -316,6 +326,13 @@ R3.CustomCode.prototype.move = function(data) {
return; return;
} }
R3.Event.Emit(
R3.Event.PLAY_AUDIO,
{
name : 'Audio - Kick'
}
);
var kickDuration = Date.now() - this.startTime; var kickDuration = Date.now() - this.startTime;
var speed = this.kickDistance / kickDuration * 20; var speed = this.kickDistance / kickDuration * 20;
@ -378,5 +395,11 @@ this.mouseMove.entityLoaded = this;
this.touchMove.entityLoaded = this; this.touchMove.entityLoaded = this;
this.beforeRender.entityLoaded = this; this.beforeRender.entityLoaded = this;
R3.Event.Emit(
R3.Event.PLAY_AUDIO,
{
name : 'Audio - Crowd'
}
);
//@ sourceURL=entityLoaded.js //@ sourceURL=entityLoaded.js