Update: CC - Mouse Down (zjg1mprub2.js) 70 bytes modified

beta.r3js.org
-=yb4f310 2017-11-25 08:52:11 +01:00
parent 7646d5b480
commit da322487f1
1 changed files with 15 additions and 13 deletions

View File

@ -21,6 +21,21 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond');
this.throwerParticleEngine.templateParticle.speed = 300;
this.throwerParticleEngine.templateParticle.scale.x = 15;
if (GameLib.Utils.UndefinedOrNull(this.subscription)) {
this.subscription = GameLib.Event.Subscribe(
GameLib.Event.AUDIO_ENDED,
function(data) {
if (data.audio.name === 'Audio - Flamethrower') {
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
if (this.subscription) {
this.subscription.remove();
this.subscription = null;
}
}
}.bind(this)
);
}
GameLib.Event.Emit(
GameLib.Event.PLAY_AUDIO,
{
@ -28,18 +43,5 @@ GameLib.Event.Emit(
}
);
this.subscription = GameLib.Event.Subscribe(
GameLib.Event.AUDIO_ENDED,
function(data) {
if (data.audio.name === 'Audio - Flamethrower') {
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
if (this.subscription) {
this.subscription.remove();
this.subscription = null;
}
}
}.bind(this)
);
return null;
//@ sourceURL=mouseDown.js