Update: CC - Before Render - Moorcow (72d6a2a3kc.js) 288 bytes modified
parent
f585830035
commit
a8e6187587
|
@ -15,9 +15,12 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
this.renderer = this.entityLoaded.renderer;
|
this.renderer = this.entityLoaded.renderer;
|
||||||
this.raycaster = this.entityLoaded.raycaster;
|
this.raycaster = this.entityLoaded.raycaster;
|
||||||
this.scene = this.entityLoaded.scene;
|
this.scene = this.entityLoaded.scene;
|
||||||
|
this.smokeParticleEngine = this.entityLoaded.smokeParticleEngine;
|
||||||
|
|
||||||
this.toBlack = new THREE.Color(0.05, 0.05, 0.05);
|
this.toBlack = new THREE.Color(0.05, 0.05, 0.05);
|
||||||
this.toRed = new THREE.Color(0.02, 0, 0);
|
this.toRed = new THREE.Color(0.02, 0, 0);
|
||||||
|
|
||||||
|
|
||||||
this.bull.instance.visible = false;
|
this.bull.instance.visible = false;
|
||||||
this.star.instance.visible = false;
|
this.star.instance.visible = false;
|
||||||
this.burger.instance.visible = false;
|
this.burger.instance.visible = false;
|
||||||
|
@ -160,8 +163,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
enemy.lifeTime = 0;
|
enemy.lifeTime = 0;
|
||||||
enemy.life = 15;
|
enemy.life = 15;
|
||||||
|
|
||||||
|
enemy.exploding = false;
|
||||||
|
|
||||||
this.enemies.push(enemy);
|
this.enemies.push(enemy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.explode = function(mesh) {
|
||||||
|
var particleEngine = this.smokeParticleEngine.clone();
|
||||||
|
particleEngine.position = mesh.position.clone();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.totalTime += data.delta;
|
this.totalTime += data.delta;
|
||||||
|
@ -214,14 +224,18 @@ if (this.mouseIsDown) {
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if (mesh.materials[0].name.indexOf('Trees') === -1) {
|
if (mesh.materials[0].name.indexOf('Trees') === -1) {
|
||||||
|
|
||||||
mesh.instance.material.color.sub(this.toBlack);
|
mesh.instance.material.color.sub(this.toBlack);
|
||||||
|
|
||||||
|
if (mesh.instance.material.color.r
|
||||||
|
|
||||||
if (mesh.instance.material.color.r <= 0) {
|
if (mesh.instance.material.color.r <= 0) {
|
||||||
if (mesh.instance.material.emissive) {
|
if (mesh.instance.material.emissive) {
|
||||||
mesh.instance.material.emissive.add(this.toRed);
|
mesh.instance.material.emissive.add(this.toRed);
|
||||||
mesh.instance.material.emissive.add(this.toRed);
|
mesh.instance.material.emissive.add(this.toRed);
|
||||||
|
|
||||||
if (mesh.instance.material.emissive.r >= 1.0) {
|
if (mesh.instance.material.emissive.r >= 0.8) {
|
||||||
console.log('!explode!' + mesh.name);
|
this.explode(mesh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue