Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 42 bytes modified
parent
18ed18831a
commit
5b5d220944
|
@ -245,17 +245,17 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
|||
|
||||
if (index === 0) {
|
||||
|
||||
body.advance(
|
||||
this.state.orientation
|
||||
);
|
||||
|
||||
backup = {
|
||||
backup = {
|
||||
position : {
|
||||
x : body.position.x,
|
||||
y : body.position.y
|
||||
},
|
||||
orientation : body.orientation
|
||||
}
|
||||
|
||||
body.advance(
|
||||
this.state.orientation
|
||||
);
|
||||
}
|
||||
|
||||
if (index > 0) {
|
||||
|
@ -284,13 +284,15 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
|||
body.mesh.remove();
|
||||
|
||||
body.mesh = body.backupMesh;
|
||||
|
||||
body.backupMesh = null;
|
||||
|
||||
body.mesh.visible = true;
|
||||
|
||||
body.mesh.updateInstance('visible');
|
||||
}
|
||||
|
||||
if (body.orientation !== backup.orientation) {
|
||||
if (body.orientation !== this.snake[index-1].orientation) {
|
||||
/**
|
||||
* Our orientation changed - we should make a corner
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue