Update: CC - SnailRunner - Entity Loaded (78gnds8jrj.js) 418 bytes modified
parent
5edc5dd67a
commit
64fb196315
|
@ -31,6 +31,13 @@ this.sun = GameLib.EntityManager.Instance.findComponentById('nkdyvga5nl');
|
|||
this.sections = [];
|
||||
this.clouds = [];
|
||||
|
||||
this.maxSpeed = 50;
|
||||
this.speedPercentage = 0;
|
||||
|
||||
this.initialCameraPosition = new THREE.Vector3(0, 1.1, 0);
|
||||
this.maximumCameraPosition = new THREE.Vector3(0, 2.6, 0);
|
||||
|
||||
|
||||
/**
|
||||
* Camera, Raycaster, Mouse
|
||||
*/
|
||||
|
@ -162,10 +169,17 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) {
|
|||
this.speed = 0;
|
||||
}
|
||||
|
||||
if (this.speed > 50) {
|
||||
this.speed = 50;
|
||||
if (this.speed > this.maxSpeed) {
|
||||
this.speed = this.maxSpeed;
|
||||
}
|
||||
|
||||
this.speedPercentage = this.speed / this.maxSpeed;
|
||||
|
||||
var pos = this.initialCameraPosition.lerp(this.maximumCameraPosition, this.speedPercentage);
|
||||
|
||||
this.camera.position.y = pos.y;
|
||||
this.camera.updateInstance('position');
|
||||
|
||||
}.bind(this);
|
||||
|
||||
GameLib.CustomCode.prototype.adjustSnailPosition = function(delta) {
|
||||
|
|
Loading…
Reference in New Issue