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.speedPercentage = 0;
|
||||||
|
|
||||||
this.cloudTime = 0;
|
this.cloudTime = 0;
|
||||||
|
this.time = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Camera settings y = height, z = FOV
|
* 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.raycaster = GameLib.EntityManager.Instance.findComponentById('h3yxd73sz7');
|
||||||
this.mouse = GameLib.EntityManager.Instance.findComponentById('eriv6mcw8k');
|
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() {
|
GameLib.CustomCode.prototype.spawnRoadSections = function() {
|
||||||
|
|
||||||
var cloneLeft = this.treesLeft.clone();
|
var cloneLeft = this.treesLeft.clone();
|
||||||
|
@ -94,6 +85,16 @@ GameLib.CustomCode.prototype.spawnRoadSections = function() {
|
||||||
|
|
||||||
}.bind(this)
|
}.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) {
|
GameLib.CustomCode.prototype.advanceClouds = function(delta) {
|
||||||
|
|
||||||
var diff = delta * this.speed;
|
var diff = delta * this.speed;
|
||||||
|
@ -129,7 +130,7 @@ GameLib.CustomCode.prototype.advanceClouds = function(delta) {
|
||||||
|
|
||||||
this.cloudTime += diff;
|
this.cloudTime += diff;
|
||||||
|
|
||||||
if (this.cloudTime > Math.PI * 2) {
|
if (this.cloudTime > 10) {
|
||||||
this.spawnCloud();
|
this.spawnCloud();
|
||||||
this.cloudTime = 0;
|
this.cloudTime = 0;
|
||||||
}
|
}
|
||||||
|
@ -256,6 +257,7 @@ GameLib.Event.Subscribe(
|
||||||
this.snail.position.z = 0;
|
this.snail.position.z = 0;
|
||||||
this.speed = 0;
|
this.speed = 0;
|
||||||
this.speedUp = false;
|
this.speedUp = false;
|
||||||
|
this.time = 0;
|
||||||
|
|
||||||
this.movement = {
|
this.movement = {
|
||||||
left : false,
|
left : false,
|
||||||
|
|
Loading…
Reference in New Issue