From eee408aae39f98a58d64a7dcf0eb44331f7bdf82 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sat, 24 Mar 2018 12:53:55 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 686 bytes modified --- 21g30t1e75.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/21g30t1e75.js b/21g30t1e75.js index 9a4ccfa..f9c6ce3 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -1239,12 +1239,36 @@ GameLib.CustomCode.prototype.restore = function() { clone.mesh.remove(); } + /** + * --- works --- + */ clone.mesh = clone.backupMesh; clone.backupMesh = null; clone.mesh.visible = true; clone.mesh.updateInstance('visible'); clone.applyToMesh(); clone.backupMesh = clone.mesh; + /** + * --- end of works --- + */ + + + if (body.orientation === GameLib.CustomCode.ORIENTATION_UP) { + body.backupMesh.position.y += 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + } + + if (body.orientation === GameLib.CustomCode.ORIENTATION_DOWN) { + body.backupMesh.position.y -= 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + } + + if (body.orientation === GameLib.CustomCode.ORIENTATION_LEFT) { + body.backupMesh.position.x -= 0.5 * GameLib.CustomCode.BODY_SCALE_X; + } + + if (body.orientation === GameLib.CustomCode.ORIENTATION_RIGHT) { + body.backupMesh.position.x += 0.5 * GameLib.CustomCode.BODY_SCALE_X; + } + clone.mesh = this.createGameMesh(this.materialBreadCorner);