Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 746 bytes modified
parent
2fff3a0272
commit
d7820f070b
|
@ -939,6 +939,10 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
if (this.state.eating === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
temp = {
|
temp = {
|
||||||
position : {
|
position : {
|
||||||
x : body.position.x,
|
x : body.position.x,
|
||||||
|
@ -948,7 +952,6 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
flip : body.flip
|
flip : body.flip
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.eating === false) {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new empty object at the current grid position (free it up)
|
* Create a new empty object at the current grid position (free it up)
|
||||||
|
@ -967,7 +970,7 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
* Update the grid with our new body
|
* Update the grid with our new body
|
||||||
*/
|
*/
|
||||||
this.grid[body.position.x][body.position.y] = body;
|
this.grid[body.position.x][body.position.y] = body;
|
||||||
}
|
|
||||||
|
|
||||||
if (body.backupMesh) {
|
if (body.backupMesh) {
|
||||||
/**
|
/**
|
||||||
|
@ -991,12 +994,8 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
body.mesh.updateInstance('position');
|
body.mesh.updateInstance('position');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (backup.orientation !== temp.orientation) {
|
if (body.orientation !== temp.orientation) {
|
||||||
|
|
||||||
// if ((index ) < this.snake.length) {
|
|
||||||
/**
|
|
||||||
* Our orientation changed - we should make a corner
|
|
||||||
*/
|
|
||||||
body.orientation = temp.orientation;
|
body.orientation = temp.orientation;
|
||||||
|
|
||||||
body.applyToMesh();
|
body.applyToMesh();
|
||||||
|
@ -1021,9 +1020,6 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
body.backupMesh.position.x -= 0.5 * GameLib.CustomCode.BODY_SCALE_X;
|
body.backupMesh.position.x -= 0.5 * GameLib.CustomCode.BODY_SCALE_X;
|
||||||
}
|
}
|
||||||
|
|
||||||
//body.backupMesh.visible = false;
|
|
||||||
|
|
||||||
//body.backupMesh.updateInstance('visible');
|
|
||||||
|
|
||||||
body.mesh = this.createGameMesh(this.materialBreadCorner);
|
body.mesh = this.createGameMesh(this.materialBreadCorner);
|
||||||
|
|
||||||
|
@ -1034,8 +1030,6 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
body.mesh.visible = true;
|
body.mesh.visible = true;
|
||||||
|
|
||||||
body.mesh.updateInstance('visible');
|
body.mesh.updateInstance('visible');
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
backup = temp;
|
backup = temp;
|
||||||
|
|
Loading…
Reference in New Issue