Update: CC - SnailRunner - Before Render (rlley2ki2i.js) 315 bytes modified
parent
fb98716cc3
commit
8cb2397773
|
@ -4,7 +4,18 @@ if (!this.entityLoaded) {
|
||||||
|
|
||||||
if (!this.initialized) {
|
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;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
@ -12,4 +23,13 @@ if (!this.initialized) {
|
||||||
this.road.rotation.z += 0.004 * data.delta;
|
this.road.rotation.z += 0.004 * data.delta;
|
||||||
this.road.updateInstance('rotation');
|
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
|
//@ sourceURL=beforeRender.js
|
Loading…
Reference in New Issue