Update: CC - Mouse Down (zjg1mprub2.js) 70 bytes modified
parent
7646d5b480
commit
da322487f1
|
@ -21,6 +21,21 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond');
|
||||||
this.throwerParticleEngine.templateParticle.speed = 300;
|
this.throwerParticleEngine.templateParticle.speed = 300;
|
||||||
this.throwerParticleEngine.templateParticle.scale.x = 15;
|
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.Emit(
|
||||||
GameLib.Event.PLAY_AUDIO,
|
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;
|
return null;
|
||||||
//@ sourceURL=mouseDown.js
|
//@ sourceURL=mouseDown.js
|
Loading…
Reference in New Issue