Update: CC - Before Render - Moorcow (080g209iov.js) 365 bytes modified
parent
138a1bd95c
commit
7024389ce0
|
@ -237,7 +237,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
explodeParticleEngine.position = mesh.position.clone();
|
explodeParticleEngine.position = mesh.position.clone();
|
||||||
explodeParticleEngine.updateInstance('position');
|
explodeParticleEngine.updateInstance('position');
|
||||||
explodeParticleEngine.enabled = true;
|
explodeParticleEngine.enabled = true;
|
||||||
enemy.explodeParticleEngine = explodeParticleEngine;
|
mesh.explodeParticleEngine = explodeParticleEngine;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
smokeParticleEngine.position = mesh.position.clone();
|
smokeParticleEngine.position = mesh.position.clone();
|
||||||
smokeParticleEngine.updateInstance('position');
|
smokeParticleEngine.updateInstance('position');
|
||||||
smokeParticleEngine.enabled = true;
|
smokeParticleEngine.enabled = true;
|
||||||
enemy.smokeParticleEngine = smokeParticleEngine;
|
mesh.smokeParticleEngine = smokeParticleEngine;
|
||||||
|
|
||||||
GameLib.Event.Emit(
|
GameLib.Event.Emit(
|
||||||
GameLib.Event.PLAY_AUDIO,
|
GameLib.Event.PLAY_AUDIO,
|
||||||
|
@ -286,7 +286,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
fireParticleEngine.position = mesh.position.clone();
|
fireParticleEngine.position = mesh.position.clone();
|
||||||
fireParticleEngine.updateInstance('position');
|
fireParticleEngine.updateInstance('position');
|
||||||
fireParticleEngine.enabled = true;
|
fireParticleEngine.enabled = true;
|
||||||
enemy.fireParticleEngine = fireParticleEngine;
|
mesh.fireParticleEngine = fireParticleEngine;
|
||||||
}
|
}
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
);
|
);
|
||||||
|
@ -318,19 +318,19 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
enemy.mesh.instance.geometry.dispose();
|
enemy.mesh.instance.geometry.dispose();
|
||||||
enemy.mesh.instance.material.dispose();
|
enemy.mesh.instance.material.dispose();
|
||||||
|
|
||||||
if (enemy.smokeParticleEngine) {
|
if (enemy.mesh.smokeParticleEngine) {
|
||||||
enemy.smokeParticleEngine.remove();
|
enemy.mesh.smokeParticleEngine.remove();
|
||||||
enemy.smokeParticleEngine = null;
|
enemy.mesh.smokeParticleEngine = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy.fireParticleEngine) {
|
if (enemy.mesh.fireParticleEngine) {
|
||||||
enemy.fireParticleEngine.remove();
|
enemy.mesh.fireParticleEngine.remove();
|
||||||
enemy.fireParticleEngine = null;
|
enemy.mesh.fireParticleEngine = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enemy.explodeParticleEngine) {
|
if (enemy.mesh.explodeParticleEngine) {
|
||||||
enemy.explodeParticleEngine.remove();
|
enemy.mesh.explodeParticleEngine.remove();
|
||||||
enemy.explodeParticleEngine = null;
|
enemy.mesh.explodeParticleEngine = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -342,6 +342,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
* Do nothing, this tree is burning
|
* Do nothing, this tree is burning
|
||||||
*/
|
*/
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
mesh.burning = true;
|
mesh.burning = true;
|
||||||
|
|
||||||
this.treesBurning++;
|
this.treesBurning++;
|
||||||
|
@ -418,10 +419,10 @@ if (this.mouseIsDown) {
|
||||||
/**
|
/**
|
||||||
* Light up the scene
|
* Light up the scene
|
||||||
*/
|
*/
|
||||||
this.fog.color.r += 0.01;
|
//this.fog.color.r += 0.01;
|
||||||
if (this.fog.color.r > 0.5) {
|
//if (this.fog.color.r > 0.5) {
|
||||||
this.fog.color.r = 0.5;
|
// this.fog.color.r = 0.5;
|
||||||
}
|
//}
|
||||||
//this.fog.updateInstance('color');
|
//this.fog.updateInstance('color');
|
||||||
|
|
||||||
this.renderer.clearColor.r += 0.01;
|
this.renderer.clearColor.r += 0.01;
|
||||||
|
@ -541,6 +542,18 @@ if (this.spawnTime > this.nextSpawnTime) {
|
||||||
this.spawnEnemy();
|
this.spawnEnemy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.kanister.explodeParticleEngine) {
|
||||||
|
|
||||||
|
if (GameLib.Utils.UndefinedOrNull(this.kanister.waiting)) {
|
||||||
|
this.kanister.waiting = true;
|
||||||
|
} else {
|
||||||
|
this.kanister.explodeParticleEngine.remove();
|
||||||
|
this.kanister.explodeParticleEngine = null;
|
||||||
|
delete this.kanister.waiting;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (this.kanisterTime > (this.kanisterLife / 2)) {
|
if (this.kanisterTime > (this.kanisterLife / 2)) {
|
||||||
this.kanister.visible = true;
|
this.kanister.visible = true;
|
||||||
this.kanister.updateInstance('visible');
|
this.kanister.updateInstance('visible');
|
||||||
|
@ -585,15 +598,15 @@ this.enemies = this.enemies.reduce(
|
||||||
if (enemy.burning) {
|
if (enemy.burning) {
|
||||||
enemy.burnTime += data.delta;
|
enemy.burnTime += data.delta;
|
||||||
if (enemy.burnTime > enemy.burnLife) {
|
if (enemy.burnTime > enemy.burnLife) {
|
||||||
enemy.smokeParticleEngine.remove();
|
enemy.mesh.smokeParticleEngine.remove();
|
||||||
enemy.fireParticleEngine.remove();
|
enemy.mesh.fireParticleEngine.remove();
|
||||||
enemy.lifeTime = enemy.life + 1;
|
enemy.lifeTime = enemy.life + 1;
|
||||||
enemy.burning = false;
|
enemy.burning = false;
|
||||||
} else {
|
} else {
|
||||||
enemy.smokeParticleEngine.position = enemy.mesh.position.clone();
|
enemy.mesh.smokeParticleEngine.position = enemy.mesh.position.clone();
|
||||||
enemy.smokeParticleEngine.updateInstance('position');
|
enemy.mesh.smokeParticleEngine.updateInstance('position');
|
||||||
enemy.fireParticleEngine.position = enemy.mesh.position.clone();
|
enemy.mesh.fireParticleEngine.position = enemy.mesh.position.clone();
|
||||||
enemy.fireParticleEngine.updateInstance('position');
|
enemy.mesh.fireParticleEngine.updateInstance('position');
|
||||||
}
|
}
|
||||||
|
|
||||||
enemy.mesh.materials[0].opacity -= 0.005;
|
enemy.mesh.materials[0].opacity -= 0.005;
|
||||||
|
|
Loading…
Reference in New Issue