Update: CC - SnailRunner - Before Render (94xi7aitax.js) 109 bytes modified

beta.r3js.org
-=yb4f310 2018-03-09 03:36:32 +01:00
parent e97b66e18f
commit 2441138268
1 changed files with 11 additions and 4 deletions

View File

@ -34,21 +34,28 @@ if (!this.initialized) {
var diff = data.delta * this.speed;
var deadClouds = this.clouds.reduce(
var cloudInfo = this.clouds.reduce(
function(result, cloud) {
cloud.position.x += diff;
cloud.updateInstance('position');
if (cloud.position.x > 50) {
result.push(cloud);
result.dead.push(cloud);
} else {
result.alive.push(cloud);
}
return result;
},
[]
{
alive : [],
dead : []
}
);
deadClouds.map(
this.clouds = cloudInfo.alive;
cloudInfo.dead.map(
function(deadCloud) {
deadCloud.geometry = null;
deadCloud.materials = null;