Update: CC - SnailRunner - Before Render (rlley2ki2i.js) 315 bytes modified

beta.r3js.org
-=yb4f310 2018-03-07 17:28:34 +01:00
parent fb98716cc3
commit 8cb2397773
1 changed files with 21 additions and 1 deletions

View File

@ -4,7 +4,18 @@ if (!this.entityLoaded) {
if (!this.initialized) {
this.road = this.entityLoaded.road;
/**
* Meshes
*/
this.road = this.entityLoaded.road;
this.cloud = this.entityLoaded.cloud;
this.time = 0;
this.spawnCloud = function() {
this.cloud.position.x = -3;
this.cloud.updateInstance('position');
}
this.initialized = true;
}
@ -12,4 +23,13 @@ if (!this.initialized) {
this.road.rotation.z += 0.004 * data.delta;
this.road.updateInstance('rotation');
this.cloud.position.x -= 0.1 * data.delta;
this.time += data.delta;
if (this.time > 3) {
this.spawnCloud();
this.time = 0;
}
//@ sourceURL=beforeRender.js