diff --git a/rlley2ki2i.js b/rlley2ki2i.js index 17f7227..6c351ec 100644 --- a/rlley2ki2i.js +++ b/rlley2ki2i.js @@ -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 \ No newline at end of file