Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 256 bytes modified
parent
0b72479c81
commit
9a4850b5d2
|
@ -1268,30 +1268,30 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
this.snake.map(
|
this.snake.map(
|
||||||
function(body, index) {
|
function(body, index) {
|
||||||
|
|
||||||
if (body.backupMesh) {
|
|
||||||
/**
|
|
||||||
* We used to be a corner, change back
|
|
||||||
* @type {null}
|
|
||||||
*/
|
|
||||||
body.mesh.geometry = null;
|
|
||||||
|
|
||||||
body.mesh.materials = null;
|
|
||||||
|
|
||||||
body.mesh.remove();
|
|
||||||
|
|
||||||
body.mesh = body.backupMesh;
|
|
||||||
|
|
||||||
body.backupMesh = null;
|
|
||||||
|
|
||||||
body.mesh.visible = true;
|
|
||||||
|
|
||||||
body.mesh.updateInstance('visible');
|
|
||||||
|
|
||||||
body.mesh.updateInstance('position');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
|
|
||||||
|
if (body.backupMesh) {
|
||||||
|
/**
|
||||||
|
* We used to be a corner, change back
|
||||||
|
* @type {null}
|
||||||
|
*/
|
||||||
|
body.mesh.geometry = null;
|
||||||
|
|
||||||
|
body.mesh.materials = null;
|
||||||
|
|
||||||
|
body.mesh.remove();
|
||||||
|
|
||||||
|
body.mesh = body.backupMesh;
|
||||||
|
|
||||||
|
body.backupMesh = null;
|
||||||
|
|
||||||
|
body.mesh.visible = true;
|
||||||
|
|
||||||
|
body.mesh.updateInstance('visible');
|
||||||
|
|
||||||
|
body.mesh.updateInstance('position');
|
||||||
|
}
|
||||||
|
|
||||||
backup = {
|
backup = {
|
||||||
position : {
|
position : {
|
||||||
x : body.position.x,
|
x : body.position.x,
|
||||||
|
@ -1441,6 +1441,28 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
*/
|
*/
|
||||||
this.grid[body.position.x][body.position.y] = body;
|
this.grid[body.position.x][body.position.y] = body;
|
||||||
|
|
||||||
|
if (body.backupMesh) {
|
||||||
|
/**
|
||||||
|
* We used to be a corner, change back
|
||||||
|
* @type {null}
|
||||||
|
*/
|
||||||
|
body.mesh.geometry = null;
|
||||||
|
|
||||||
|
body.mesh.materials = null;
|
||||||
|
|
||||||
|
body.mesh.remove();
|
||||||
|
|
||||||
|
body.mesh = body.backupMesh;
|
||||||
|
|
||||||
|
body.backupMesh = null;
|
||||||
|
|
||||||
|
body.mesh.visible = true;
|
||||||
|
|
||||||
|
body.mesh.updateInstance('visible');
|
||||||
|
|
||||||
|
body.mesh.updateInstance('position');
|
||||||
|
}
|
||||||
|
|
||||||
if (body.orientation !== temp.orientation) {
|
if (body.orientation !== temp.orientation) {
|
||||||
this.createCorner(body, temp);
|
this.createCorner(body, temp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue