Update: CC - Before Render - Moorcow (080g209iov.js) 365 bytes modified

beta.r3js.org
-=yb4f310 2017-11-18 08:58:51 +01:00
parent 138a1bd95c
commit 7024389ce0
1 changed files with 35 additions and 22 deletions

View File

@ -237,7 +237,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
explodeParticleEngine.position = mesh.position.clone();
explodeParticleEngine.updateInstance('position');
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.updateInstance('position');
smokeParticleEngine.enabled = true;
enemy.smokeParticleEngine = smokeParticleEngine;
mesh.smokeParticleEngine = smokeParticleEngine;
GameLib.Event.Emit(
GameLib.Event.PLAY_AUDIO,
@ -286,7 +286,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
fireParticleEngine.position = mesh.position.clone();
fireParticleEngine.updateInstance('position');
fireParticleEngine.enabled = true;
enemy.fireParticleEngine = fireParticleEngine;
mesh.fireParticleEngine = fireParticleEngine;
}
}.bind(this)
);
@ -318,19 +318,19 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
enemy.mesh.instance.geometry.dispose();
enemy.mesh.instance.material.dispose();
if (enemy.smokeParticleEngine) {
enemy.smokeParticleEngine.remove();
enemy.smokeParticleEngine = null;
if (enemy.mesh.smokeParticleEngine) {
enemy.mesh.smokeParticleEngine.remove();
enemy.mesh.smokeParticleEngine = null;
}
if (enemy.fireParticleEngine) {
enemy.fireParticleEngine.remove();
enemy.fireParticleEngine = null;
if (enemy.mesh.fireParticleEngine) {
enemy.mesh.fireParticleEngine.remove();
enemy.mesh.fireParticleEngine = null;
}
if (enemy.explodeParticleEngine) {
enemy.explodeParticleEngine.remove();
enemy.explodeParticleEngine = null;
if (enemy.mesh.explodeParticleEngine) {
enemy.mesh.explodeParticleEngine.remove();
enemy.mesh.explodeParticleEngine = null;
}
};
@ -342,6 +342,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
* Do nothing, this tree is burning
*/
} else {
mesh.burning = true;
this.treesBurning++;
@ -418,10 +419,10 @@ if (this.mouseIsDown) {
/**
* Light up the scene
*/
this.fog.color.r += 0.01;
if (this.fog.color.r > 0.5) {
this.fog.color.r = 0.5;
}
//this.fog.color.r += 0.01;
//if (this.fog.color.r > 0.5) {
// this.fog.color.r = 0.5;
//}
//this.fog.updateInstance('color');
this.renderer.clearColor.r += 0.01;
@ -541,6 +542,18 @@ if (this.spawnTime > this.nextSpawnTime) {
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)) {
this.kanister.visible = true;
this.kanister.updateInstance('visible');
@ -585,15 +598,15 @@ this.enemies = this.enemies.reduce(
if (enemy.burning) {
enemy.burnTime += data.delta;
if (enemy.burnTime > enemy.burnLife) {
enemy.smokeParticleEngine.remove();
enemy.fireParticleEngine.remove();
enemy.mesh.smokeParticleEngine.remove();
enemy.mesh.fireParticleEngine.remove();
enemy.lifeTime = enemy.life + 1;
enemy.burning = false;
} else {
enemy.smokeParticleEngine.position = enemy.mesh.position.clone();
enemy.smokeParticleEngine.updateInstance('position');
enemy.fireParticleEngine.position = enemy.mesh.position.clone();
enemy.fireParticleEngine.updateInstance('position');
enemy.mesh.smokeParticleEngine.position = enemy.mesh.position.clone();
enemy.mesh.smokeParticleEngine.updateInstance('position');
enemy.mesh.fireParticleEngine.position = enemy.mesh.position.clone();
enemy.mesh.fireParticleEngine.updateInstance('position');
}
enemy.mesh.materials[0].opacity -= 0.005;