Update: CC - Before Render - Moorcow (to6trvr3fj.js) 746 bytes modified
parent
7c8c9a9f28
commit
b557a8f1e9
|
@ -181,12 +181,50 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
|||
console.log('exploding enemy');
|
||||
enemy.exploding = true;
|
||||
|
||||
var sound = GameLib.Utils.GetRandomIntInclusive(1,3);
|
||||
|
||||
var name = 'Audio - Blast 1';
|
||||
|
||||
if (sound === 2) {
|
||||
name = 'Audio - Blast 2';
|
||||
}
|
||||
|
||||
if (sound === 3) {
|
||||
name = 'Audio - Blast 3';
|
||||
}
|
||||
|
||||
this.blastSubscription = GameLib.Event.Subscribe(
|
||||
GameLib.Event.AUDIO_ENDED,
|
||||
function(data) {
|
||||
|
||||
if (this.blastSubscription) {
|
||||
|
||||
this.blastSubscription.remove();
|
||||
|
||||
this.blastSubscription = null;
|
||||
|
||||
if (data.name === name) {
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.PLAY_AUDIO,
|
||||
{
|
||||
name : 'Audio - Ho ho ho'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.PLAY_AUDIO,
|
||||
{
|
||||
name : name
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// var particleEngine = this.smokeParticleEngine.clone();
|
||||
// particleEngine.position = mesh.position.clone();
|
||||
// particleEngine.updateInstance('position');
|
||||
|
|
Loading…
Reference in New Issue