From c3834b0f84f393446e3a644974e44596e9c8bbb2 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Mon, 19 Mar 2018 11:46:38 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 156 bytes modified --- 21g30t1e75.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/21g30t1e75.js b/21g30t1e75.js index 89dea3b..baec3c2 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -184,7 +184,12 @@ GameLib.CustomCode.SnakeBody.prototype.applyToMesh = function() { this.mesh.position.x = this.position.x + GameLib.CustomCode.GRID_OFFSET_X; this.mesh.position.y = this.position.y + GameLib.CustomCode.GRID_OFFSET_Y; - this.mesh.rotation.z = this.orientation * Math.PI / 2; + if (((this.orientation * Math.PI / 2) - this.mesh.rotation.z) > Math.PI) { + this.mesh.rotation.z -= Math.PI; + this.mesh.updateInstance('rotation'); + } + + this.mesh.rotation.z = this.orientation * Math.PI / 2; if (this.backupMesh) { this.mesh.rotation.z += ((Math.PI / 2) * this.flip);