diff --git a/78gnds8jrj.js b/78gnds8jrj.js index 80a132d..b72ccdd 100644 --- a/78gnds8jrj.js +++ b/78gnds8jrj.js @@ -41,6 +41,13 @@ this.initialCameraSettings = new THREE.Vector3(0, 1.1, 40); this.maximumCameraSettings = new THREE.Vector3(0, 2.6, 90); this.currentCameraSettings = new THREE.Vector3(0, 1.1, 40); +this.intitialSnailSettings = new THREE.Vector3(0, 0, 0); +this.maximumSnailSettings = new THREE.Vector3(0, 0, 0); +this.currentSnailSettings = new THREE.Vector3(0, 0, 0); + +this.currentSnailPosition = new THREE.Vector3(0, 0, 0); +this.targetSnailPosition = new THREE.Vector3(0, 0, 0); + /** * Camera, Raycaster, Mouse */ @@ -195,22 +202,24 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) { GameLib.CustomCode.prototype.adjustSnailPosition = function(delta) { - var diff = delta * 5; - var modified = false; +// var diff = delta * 5; +// var modified = false; - if (this.movement.left) { - this.snail.position.z += diff; - this.movement.left = false; - modified = true; - } +// if (this.movement.left) { +// this.snail.position.z += diff; +// this.movement.left = false; +// modified = true; +// } - if (this.movement.right) { - this.snail.position.z -= diff; - this.movement.right = false; - modified = true; - } +// if (this.movement.right) { +// this.snail.position.z -= diff; +// this.movement.right = false; +// modified = true; +// } + +// if (modified) { + this.snail.position.z = this.targetSnailPosition.z; - if (modified) { if (this.snail.position.z < -4.8) { this.snail.position.z = -4.8; } @@ -223,7 +232,7 @@ GameLib.CustomCode.prototype.adjustSnailPosition = function(delta) { this.snail.updateInstance('position'); this.solar.updateInstance('position'); - } +// } }.bind(this); @@ -242,6 +251,7 @@ GameLib.CustomCode.prototype.update3dCursor = function() { ) ); + this.targetSnailPosition.z = cursorPosition.z; // this.sun.position.setFrom(cursorPosition); // this.sun.updateInstance('position'); @@ -278,6 +288,8 @@ GameLib.Event.Subscribe( this.clouds = []; + this.currentSnailPosition.z = this.snail.position.z; + /** * Activate our custom code components */