Update: CC - SnailRunner - Entity Loaded (78gnds8jrj.js) 28 bytes modified
parent
2484e8d210
commit
7cd87f9cbb
|
@ -35,6 +35,7 @@ this.maxSpeed = 50;
|
|||
this.speedPercentage = 0;
|
||||
|
||||
this.cloudTime = 0;
|
||||
this.time = 0;
|
||||
|
||||
/**
|
||||
* Camera settings y = height, z = FOV
|
||||
|
@ -57,16 +58,6 @@ this.camera = GameLib.EntityManager.Instance.findComponentById('hd8dsn7o4c');
|
|||
this.raycaster = GameLib.EntityManager.Instance.findComponentById('h3yxd73sz7');
|
||||
this.mouse = GameLib.EntityManager.Instance.findComponentById('eriv6mcw8k');
|
||||
|
||||
GameLib.CustomCode.prototype.spawnCloud = function() {
|
||||
var cloud = this.cloud.clone();
|
||||
|
||||
this.cloud.position.x = -155;
|
||||
this.cloud.position.z = Math.sin(this.cloudTime) * 30;
|
||||
this.cloud.updateInstance('position');
|
||||
|
||||
this.clouds.push(cloud);
|
||||
}.bind(this)
|
||||
|
||||
GameLib.CustomCode.prototype.spawnRoadSections = function() {
|
||||
|
||||
var cloneLeft = this.treesLeft.clone();
|
||||
|
@ -94,6 +85,16 @@ GameLib.CustomCode.prototype.spawnRoadSections = function() {
|
|||
|
||||
}.bind(this)
|
||||
|
||||
GameLib.CustomCode.prototype.spawnCloud = function() {
|
||||
var cloud = this.cloud.clone();
|
||||
|
||||
this.cloud.position.x = -155;
|
||||
this.cloud.position.z = Math.sin(this.time / 10) * 30;
|
||||
this.cloud.updateInstance('position');
|
||||
|
||||
this.clouds.push(cloud);
|
||||
}.bind(this)
|
||||
|
||||
GameLib.CustomCode.prototype.advanceClouds = function(delta) {
|
||||
|
||||
var diff = delta * this.speed;
|
||||
|
@ -129,7 +130,7 @@ GameLib.CustomCode.prototype.advanceClouds = function(delta) {
|
|||
|
||||
this.cloudTime += diff;
|
||||
|
||||
if (this.cloudTime > Math.PI * 2) {
|
||||
if (this.cloudTime > 10) {
|
||||
this.spawnCloud();
|
||||
this.cloudTime = 0;
|
||||
}
|
||||
|
@ -256,7 +257,8 @@ GameLib.Event.Subscribe(
|
|||
this.snail.position.z = 0;
|
||||
this.speed = 0;
|
||||
this.speedUp = false;
|
||||
|
||||
this.time = 0;
|
||||
|
||||
this.movement = {
|
||||
left : false,
|
||||
right : false,
|
||||
|
|
Loading…
Reference in New Issue