Update: CC - Before Render - Moorcow (a2ow5l92js.js) 223 bytes modified
parent
9e42b648ef
commit
fb9156c0e1
|
@ -342,9 +342,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
enemy.explodingLife = 2;
|
enemy.explodingLife = 2;
|
||||||
enemy.meshType = meshType;
|
enemy.meshType = meshType;
|
||||||
enemy.score = score;
|
enemy.score = score;
|
||||||
|
enemy.isKanister = false;
|
||||||
|
|
||||||
if (kanister) {
|
if (kanister) {
|
||||||
|
enemy.isKanister = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
GameLib.Event.Emit(
|
GameLib.Event.Emit(
|
||||||
|
@ -447,54 +448,45 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
|
|
||||||
enemy.exploding = true;
|
enemy.exploding = true;
|
||||||
|
|
||||||
console.log('exploding enemy');
|
if (enemy.isKanister) {
|
||||||
|
this.kanisters += 1;
|
||||||
|
|
||||||
this.score += enemy.score;
|
console.log('exploding kanister');
|
||||||
|
} else {
|
||||||
|
|
||||||
console.log('score : ' + this.score);
|
console.log('exploding enemy');
|
||||||
|
|
||||||
GameLib.Event.Emit(
|
this.score += enemy.score;
|
||||||
GameLib.Event.GAME_DATA,
|
|
||||||
{
|
console.log('score : ' + this.score);
|
||||||
event : 'scoreUpdate',
|
|
||||||
score : this.score
|
GameLib.Event.Emit(
|
||||||
|
GameLib.Event.GAME_DATA,
|
||||||
|
{
|
||||||
|
event : 'scoreUpdate',
|
||||||
|
score : this.score
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this.score > this.kanisterSpawnScore) {
|
||||||
|
this.spawnKanister();
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
|
||||||
if (this.score > this.kanisterSpawnScore) {
|
GameLib.Event.Emit(
|
||||||
this.spawnKanister();
|
GameLib.Event.GAME_DATA,
|
||||||
|
{
|
||||||
|
enemy : enemy,
|
||||||
|
event : 'enemyExploded'
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameLib.Event.Emit(
|
|
||||||
GameLib.Event.GAME_DATA,
|
|
||||||
{
|
|
||||||
enemy : enemy,
|
|
||||||
event : 'enemyExploded'
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
this.explodeMesh(mesh);
|
this.explodeMesh(mesh);
|
||||||
}
|
}
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.explodeKanister = function(mesh) {
|
|
||||||
this.kanisters += 1;
|
|
||||||
//this.kanisterTime = 0;
|
|
||||||
// this.fuelFinished = false;
|
|
||||||
this.explodeMesh(mesh);
|
|
||||||
if (mesh.explodeParticleEngine) {
|
|
||||||
if (GameLib.Utils.UndefinedOrNull(mesh.waiting)) {
|
|
||||||
mesh.waiting = true;
|
|
||||||
} else {
|
|
||||||
mesh.explodeParticleEngine.remove();
|
|
||||||
mesh.explodeParticleEngine = null;
|
|
||||||
delete mesh.waiting;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
this.burn = function(mesh) {
|
this.burn = function(mesh) {
|
||||||
|
|
||||||
this.enemies.map(
|
this.enemies.map(
|
||||||
|
@ -709,7 +701,7 @@ if (this.mouseIsDown)
|
||||||
var mesh = intersect.mesh;
|
var mesh = intersect.mesh;
|
||||||
|
|
||||||
if (mesh.name.indexOf('Kanister') !== -1) {
|
if (mesh.name.indexOf('Kanister') !== -1) {
|
||||||
this.explodeKanister(mesh);
|
this.explode(mesh);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue