Update: CC - Before Render - Moorcow (zo950m57cc.js) 185 bytes modified

beta.r3js.org
-=yb4f310 2017-11-26 23:37:01 +01:00
parent 14ff6e3f79
commit 85657e9c8f
1 changed files with 15 additions and 10 deletions

View File

@ -228,7 +228,7 @@
mesh = this.meshes[meshType][i].mesh; mesh = this.meshes[meshType][i].mesh;
mesh.burnLife = 1; mesh.burnLife = 1;
mesh.explodeLife = 1; mesh.explodeLife = 1;
mesh.instance.material.color.set(1,1,1); mesh.instance.material.color.setRGB(1,1,1);
return mesh; return mesh;
} }
@ -567,15 +567,20 @@
this.kill = function(enemy) { this.kill = function(enemy) {
this.meshes[enemy.meshType] = this.meshes[enemy.meshType].map( var found = false;
function(object) {
if (object.mesh === enemy.mesh) { for (var i = 0; i < this.meshes[enemy.meshType].length; i++) {
object.inUse = false; if (this.meshes[enemy.meshType].mesh === enemy.mesh) {
object.mesh.visible = false; found = true;
object.mesh.updateInstance('visible'); this.meshes[enemy.meshType].inUse = false;
} this.meshes[enemy.meshType].mesh.visible = false;
this.meshes[enemy.meshType].mesh.updateInstance('visible');
} }
) }
if (!found) {
console.warn('could not find mesh to kill');
}
/** /**
* We only remove the things we cloned * We only remove the things we cloned
@ -787,7 +792,7 @@
} }
} }
mesh.instance.material.color.set( mesh.instance.material.color.setRGB(
1 - mesh.explodeLife, 1 - mesh.explodeLife,
mesh.burnLife, mesh.burnLife,
mesh.burnLife mesh.burnLife