diff --git a/to6trvr3fj.js b/to6trvr3fj.js index 62b1375..ef77e37 100644 --- a/to6trvr3fj.js +++ b/to6trvr3fj.js @@ -169,7 +169,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { enemy.burnLife = 3; enemy.burnTime = 0; enemy.explodingLife = 2; - + this.enemies.push(enemy); } @@ -343,16 +343,17 @@ if (this.mouseIsDown) { /** * This happens to trees */ - mesh.instance.material.color.sub(this.toBlack); + if (GameLib.Utils.UndefinedOrNull(mesh.userData.life)) { + mesh.userData.life = 1.2; + } - mesh.materials[0].color.r = mesh.instance.material.color.r; - mesh.materials[0].color.g = mesh.instance.material.color.g; - mesh.materials[0].color.b = mesh.instance.material.color.b; + mesh.userData.life -= 0.2; + // Don't do the color instance //mesh.materials[0].color.instance = mesh.instance.material.color; - if (mesh.instance.material.color.r <= 0) { + if (mesh.userData.life <= 0) { this.burnTree(mesh); if (mesh.instance.material.emissive) {