Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 937 bytes modified
parent
fdc8eb81f5
commit
c17ed61661
|
@ -252,7 +252,7 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
},
|
},
|
||||||
orientation : body.orientation
|
orientation : body.orientation
|
||||||
}
|
}
|
||||||
|
|
||||||
body.advance(
|
body.advance(
|
||||||
this.state.orientation
|
this.state.orientation
|
||||||
);
|
);
|
||||||
|
@ -267,20 +267,51 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
},
|
},
|
||||||
orientation : body.orientation
|
orientation : body.orientation
|
||||||
}
|
}
|
||||||
|
|
||||||
body.position.x = backup.position.x;
|
body.position.x = backup.position.x;
|
||||||
body.position.y = backup.position.y;
|
body.position.y = backup.position.y;
|
||||||
body.orientation = backup.orientation;
|
body.orientation = backup.orientation;
|
||||||
|
|
||||||
|
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.mesh.visible = true;
|
||||||
|
|
||||||
|
body.mesh.updateInstance('visible');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (body.orientation !== temp.orientation) {
|
||||||
|
/**
|
||||||
|
* Our orientation changed - we should make a corner
|
||||||
|
*/
|
||||||
|
body.backupMesh = body.mesh;
|
||||||
|
|
||||||
|
body.backupMesh.visible = false;
|
||||||
|
|
||||||
|
body.backupMesh.updateInstance('visible');
|
||||||
|
|
||||||
|
body.mesh = this.meshBreadCorner.clone();
|
||||||
|
}
|
||||||
|
|
||||||
backup = temp;
|
backup = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
body.applyToMesh();
|
body.applyToMesh();
|
||||||
|
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
)
|
)
|
||||||
|
|
||||||
return;
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue