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 {
|
} 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 = {
|
var temp = {
|
||||||
x : body.position.x,
|
x : body.position.x,
|
||||||
|
@ -257,8 +244,31 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
body.position.x = backup.x;
|
body.position.x = backup.x;
|
||||||
body.position.y = backup.y;
|
body.position.y = backup.y;
|
||||||
body.orientation = backup.orientation;
|
body.orientation = backup.orientation;
|
||||||
|
|
||||||
|
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;
|
body.bodyType = backup.bodyType;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
backup.x = temp.x;
|
backup.x = temp.x;
|
||||||
backup.y = temp.y;
|
backup.y = temp.y;
|
||||||
backup.orientation = temp.orientation;
|
backup.orientation = temp.orientation;
|
||||||
|
|
Loading…
Reference in New Issue