From 126848209379ba0276c25848657997ee5a63feaa Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sat, 24 Mar 2018 14:04:29 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 2079 bytes modified --- 21g30t1e75.js | 77 ++------------------------------------------------- 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/21g30t1e75.js b/21g30t1e75.js index c727e46..5954ef0 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -1121,8 +1121,6 @@ GameLib.CustomCode.prototype.createCorner = function(body, temp) { body.applyToMesh(); body.backupMesh = body.mesh; - - body.backupMesh.orientation = body.orientation; if (temp.orientation === GameLib.CustomCode.ORIENTATION_UP) { body.backupMesh.position.y -= 0.5 * GameLib.CustomCode.BODY_SCALE_Y; @@ -1142,8 +1140,6 @@ GameLib.CustomCode.prototype.createCorner = function(body, temp) { body.orientation = backupOrientation; - body.mesh.orientation = body.orientation; - body.mesh = this.createGameMesh(this.materialBreadCorner); body.mesh.position.z = 5; @@ -1243,30 +1239,14 @@ GameLib.CustomCode.prototype.restore = function() { clone.mesh.remove(); } - /** - * --- works --- - */ clone.mesh = clone.backupMesh; - var backupOrientation = clone.orientation; - - if (clone.backupMesh.hasOwnProperty('orientation')) { - // clone.orientation = clone.backupMesh.orientation; - } - clone.backupMesh = null; clone.mesh.visible = true; clone.mesh.updateInstance('visible'); clone.applyToMesh(); clone.backupMesh = clone.mesh; - - clone.orientation = backupOrientation; - - /** - * --- end of works --- - */ - - + if (clone.orientation === GameLib.CustomCode.ORIENTATION_UP) { clone.backupMesh.position.y += 0.5 * GameLib.CustomCode.BODY_SCALE_Y; } @@ -1289,67 +1269,14 @@ GameLib.CustomCode.prototype.restore = function() { } else { clone.mesh = this.createGameMesh(this.materialBreadCorner); } - //clone.mesh.visible = false; - //clone.mesh.updateInstance('visible'); clone.applyToMesh(); - //clone.mesh.rotation.z = clone.orientation * Math.PI / 2; - //clone.mesh.rotation.z += ((Math.PI / 2) * clone.flip); - //clone.mesh.updateInstance('rotation'); - } else { clone.mesh.visible = true; clone.mesh.updateInstance('visible'); clone.applyToMesh(); - } - - /* - if (clone.backupMesh) { - - if (clone.mesh) { - clone.mesh.geometry = null; - clone.mesh.materials = null; - clone.mesh.remove(); - } - - clone.backupMesh.visible = true; - - clone.backupMesh.position.x = clone.position.x * GameLib.CustomCode.BODY_SCALE_X + GameLib.CustomCode.GRID_OFFSET_X; - clone.backupMesh.position.y = clone.position.y * GameLib.CustomCode.BODY_SCALE_Y + GameLib.CustomCode.GRID_OFFSET_Y; - clone.backupMesh.position.z = 0.1; - - clone.backupMesh.rotation.z = clone.orientation * Math.PI / 2; - - - clone.backupMesh.updateInstance('rotation'); - - clone.backupMesh.updateInstance('visible'); - - clone.mesh = this.createGameMesh(this.materialBreadCorner); - clone.mesh.rotation.z = clone.orientation * Math.PI / 2; - clone.mesh.rotation.z += ((Math.PI / 2) * clone.flip); - clone.mesh.updateInstance('rotation'); - - - clone.mesh.position.x = clone.position.x * GameLib.CustomCode.BODY_SCALE_X + GameLib.CustomCode.GRID_OFFSET_X; - clone.mesh.position.y = clone.position.y * GameLib.CustomCode.BODY_SCALE_Y + GameLib.CustomCode.GRID_OFFSET_Y; - clone.mesh.position.z = 5; - - clone.mesh.updateInstance('position'); - - clone.mesh.visible = true; - - clone.mesh.updateInstance('visible'); - - - } else { - clone.mesh.visible = true; - clone.mesh.updateInstance('visible'); - clone.applyToMesh(); - } - */ - + } this.grid[clone.position.x][clone.position.y] = clone;