From 89129bf70404c6e0db78f48f991d0f34c62f840a Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Fri, 9 Mar 2018 15:31:33 +0100 Subject: [PATCH] Update: CC - SnailRunner - Entity Loaded (78gnds8jrj.js) 414 bytes modified --- 78gnds8jrj.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/78gnds8jrj.js b/78gnds8jrj.js index 436c702..a6b397f 100644 --- a/78gnds8jrj.js +++ b/78gnds8jrj.js @@ -165,6 +165,26 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) { }.bind(this); +GameLib.CustomCode.prototype.adjustSnailPosition = function(diff) { + + this.snail.position.z -= diff * 0.001 * this.speed; + + if (this.snail.position.z < -4.8) { + this.snail.position.z = -4.8; + } + + if (this.snail.position.z > 4.8) { + this.snail.position.z = 4.8; + } + + this.solar.position.z = this.snail.position.z; + + this.snail.updateInstance('position'); + this.solar.updateInstance('position'); + +}.bind(this); + + GameLib.Event.Subscribe( GameLib.Event.GAME_START, function() {