Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 2079 bytes modified

beta.r3js.org
-=yb4f310 2018-03-24 14:04:29 +01:00
parent afba50a53f
commit 1268482093
1 changed files with 2 additions and 75 deletions

View File

@ -1122,8 +1122,6 @@ GameLib.CustomCode.prototype.createCorner = function(body, temp) {
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,14 +1269,8 @@ 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;
@ -1304,53 +1278,6 @@ GameLib.CustomCode.prototype.restore = function() {
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;
return clone;