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.life = 15;
|
||||||
|
|
||||||
enemy.exploding = false;
|
enemy.exploding = false;
|
||||||
|
enemy.burning = false;
|
||||||
enemy.explodingLife = 2;
|
enemy.explodingLife = 2;
|
||||||
|
|
||||||
this.enemies.push(enemy);
|
this.enemies.push(enemy);
|
||||||
|
@ -176,6 +177,25 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) {
|
||||||
if (enemy.mesh === mesh && !enemy.exploding) {
|
if (enemy.mesh === mesh && !enemy.exploding) {
|
||||||
console.log('exploding enemy');
|
console.log('exploding enemy');
|
||||||
enemy.exploding = true;
|
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();
|
var particleEngine = this.smokeParticleEngine.clone();
|
||||||
particleEngine.position = mesh.position.clone();
|
particleEngine.position = mesh.position.clone();
|
||||||
particleEngine.updateInstance('position');
|
particleEngine.updateInstance('position');
|
||||||
|
@ -254,6 +274,8 @@ if (this.mouseIsDown) {
|
||||||
|
|
||||||
if (mesh.instance.material.color.r <= 0) {
|
if (mesh.instance.material.color.r <= 0) {
|
||||||
|
|
||||||
|
this.burn(mesh);
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue