beta.r3js.org
-=yb4f310 2018-05-21 00:06:04 +02:00
parent 838a71f78e
commit f333c89486
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!');
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