Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 120 bytes modified
parent
4853591f23
commit
6a864c95e8
|
@ -232,20 +232,7 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
|||
|
||||
} else {
|
||||
|
||||
if (
|
||||
index === 1 &&
|
||||
this.state.turning &&
|
||||
body.bodyType !== GameLib.CustomCode.BODY_TYPE_TAIL
|
||||
) {
|
||||
|
||||
body.backupMesh = body.mesh;
|
||||
|
||||
body.mesh = this.meshBreadCorner.clone();
|
||||
|
||||
body.bodyType = GameLib.CustomCode.BODY_TYPE_CORNER;
|
||||
|
||||
this.state.turning = false;
|
||||
}
|
||||
|
||||
|
||||
var temp = {
|
||||
x : body.position.x,
|
||||
|
@ -257,8 +244,31 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
|||
body.position.x = backup.x;
|
||||
body.position.y = backup.y;
|
||||
body.orientation = backup.orientation;
|
||||
body.bodyType = backup.bodyType;
|
||||
|
||||
|
||||
if (
|
||||
index === 1 &&
|
||||
this.state.turning &&
|
||||
body.bodyType !== GameLib.CustomCode.BODY_TYPE_TAIL
|
||||
) {
|
||||
|
||||
body.backupMesh = body.mesh;
|
||||
|
||||
body.backupMesh.visible = false;
|
||||
|
||||
body.backupMesh.updateInstance('visible');
|
||||
|
||||
body.mesh = this.meshBreadCorner.clone();
|
||||
|
||||
body.bodyType = GameLib.CustomCode.BODY_TYPE_CORNER;
|
||||
|
||||
this.state.turning = false;
|
||||
|
||||
} else {
|
||||
|
||||
body.bodyType = backup.bodyType;
|
||||
|
||||
}
|
||||
|
||||
backup.x = temp.x;
|
||||
backup.y = temp.y;
|
||||
backup.orientation = temp.orientation;
|
||||
|
|
Loading…
Reference in New Issue