Update: CC - Before Render - Moorcow (72d6a2a3kc.js) 549 bytes modified
parent
908bb40b36
commit
59b3f5b6ef
|
@ -164,6 +164,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
|||
enemy.life = 15;
|
||||
|
||||
enemy.exploding = false;
|
||||
enemy.burning = false;
|
||||
enemy.explodingLife = 2;
|
||||
|
||||
this.enemies.push(enemy);
|
||||
|
@ -176,6 +177,25 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
|||
if (enemy.mesh === mesh && !enemy.exploding) {
|
||||
console.log('exploding enemy');
|
||||
enemy.exploding = true;
|
||||
// var particleEngine = this.smokeParticleEngine.clone();
|
||||
// particleEngine.position = mesh.position.clone();
|
||||
// particleEngine.updateInstance('position');
|
||||
// particleEngine.enabled = true;
|
||||
// enemy.smokeParticleEngine = particleEngine;
|
||||
}
|
||||
}.bind(this)
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.burn = function(mesh) {
|
||||
|
||||
this.enemies.map(
|
||||
function(enemy) {
|
||||
if (enemy.mesh === mesh && !enemy.burning) {
|
||||
console.log('burning enemy');
|
||||
enemy.burning = true;
|
||||
var particleEngine = this.smokeParticleEngine.clone();
|
||||
particleEngine.position = mesh.position.clone();
|
||||
particleEngine.updateInstance('position');
|
||||
|
@ -251,9 +271,11 @@ if (this.mouseIsDown) {
|
|||
if (mesh.materials[0].name.indexOf('Trees') === -1) {
|
||||
|
||||
mesh.instance.material.color.sub(this.toBlack);
|
||||
|
||||
|
||||
if (mesh.instance.material.color.r <= 0) {
|
||||
|
||||
this.burn(mesh);
|
||||
|
||||
if (mesh.instance.material.emissive) {
|
||||
mesh.instance.material.emissive.add(this.toRed);
|
||||
mesh.instance.material.emissive.add(this.toRed);
|
||||
|
|
Loading…
Reference in New Issue