From 5060d0daab5523b0535e5fd8d46d6251c3063e55 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sun, 26 Nov 2017 23:16:45 +0100 Subject: [PATCH] Update: CC - Before Render - Moorcow (zo950m57cc.js) 48 bytes modified --- zo950m57cc.js | 47 ++++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/zo950m57cc.js b/zo950m57cc.js index edd1b90..ed436d0 100644 --- a/zo950m57cc.js +++ b/zo950m57cc.js @@ -711,24 +711,24 @@ if (this.scoreMesh.materials[0].opacity < 0) { this.scoreMesh.materials[0].updateInstance('opacity'); /* -this.scene.meshes.map( - function(mesh) { - if (mesh.instance.material instanceof Array) { - mesh.instance.material.map( - function(material) { - if (material.color) { - material.color.sub(this.toRed); - } - }.bind(this) - ); - } else { - if (mesh.instance.material.color) { - mesh.instance.material.color.sub(this.toRed); - } - } - }.bind(this) -); -*/ + this.scene.meshes.map( + function(mesh) { + if (mesh.instance.material instanceof Array) { + mesh.instance.material.map( + function(material) { + if (material.emissive) { + material.emissive.sub(this.toRed); + } + }.bind(this) + ); + } else { + if (mesh.instance.material.emissive) { + mesh.instance.material.emissive.sub(this.toRed); + } + } + }.bind(this) + ); + */ if (this.mouseIsDown) { @@ -806,16 +806,9 @@ if (this.mouseIsDown) mesh.life = 1.2; } - mesh.life -= 0.2; + mesh.life -= 0.2 * data.delta; - if (mesh.life <= 0) { - this.burnTree(mesh); - - if (mesh.instance.material.color) { - mesh.instance.material.color.add(this.toRed); - mesh.instance.material.color.add(this.toRed); - } - } + this.burnTree(mesh); } } }.bind(this)