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.meshType = meshType;
|
||||
enemy.score = score;
|
||||
enemy.isKanister = false;
|
||||
|
||||
if (kanister) {
|
||||
|
||||
enemy.isKanister = true;
|
||||
} else {
|
||||
|
||||
GameLib.Event.Emit(
|
||||
|
@ -354,7 +355,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
|||
enemy: enemy,
|
||||
event: 'enemySpawned'
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
this.enemies.push(enemy);
|
||||
|
@ -447,54 +448,45 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
|||
|
||||
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(
|
||||
GameLib.Event.GAME_DATA,
|
||||
{
|
||||
event : 'scoreUpdate',
|
||||
score : this.score
|
||||
this.score += enemy.score;
|
||||
|
||||
console.log('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) {
|
||||
this.spawnKanister();
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.GAME_DATA,
|
||||
{
|
||||
enemy : enemy,
|
||||
event : 'enemyExploded'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
GameLib.Event.Emit(
|
||||
GameLib.Event.GAME_DATA,
|
||||
{
|
||||
enemy : enemy,
|
||||
event : 'enemyExploded'
|
||||
}
|
||||
);
|
||||
|
||||
this.explodeMesh(mesh);
|
||||
}
|
||||
}.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.enemies.map(
|
||||
|
@ -709,7 +701,7 @@ if (this.mouseIsDown)
|
|||
var mesh = intersect.mesh;
|
||||
|
||||
if (mesh.name.indexOf('Kanister') !== -1) {
|
||||
this.explodeKanister(mesh);
|
||||
this.explode(mesh);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue