Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 469 bytes modified
parent
aad44574dc
commit
f99160dc04
|
@ -271,6 +271,13 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
body.mesh.visible = true;
|
body.mesh.visible = true;
|
||||||
body.mesh.updateInstance('visible');
|
body.mesh.updateInstance('visible');
|
||||||
} else if (backup.bodyType === GameLib.CustomCode.BODY_TYPE_CORNER) {
|
} else if (backup.bodyType === GameLib.CustomCode.BODY_TYPE_CORNER) {
|
||||||
|
|
||||||
|
if (index === (this.snake.length - 1)) {
|
||||||
|
|
||||||
|
backup.bodyType = GameLib.CustomCode.BODY_TYPE_TAIL;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
body.backupMesh = body.mesh;
|
body.backupMesh = body.mesh;
|
||||||
|
|
||||||
body.backupMesh.visible = false;
|
body.backupMesh.visible = false;
|
||||||
|
@ -280,6 +287,8 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
body.mesh = this.meshBreadCorner.clone();
|
body.mesh = this.meshBreadCorner.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
body.bodyType = backup.bodyType;
|
body.bodyType = backup.bodyType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -289,22 +298,6 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
backup.orientation = temp.orientation;
|
backup.orientation = temp.orientation;
|
||||||
backup.bodyType = temp.bodyType
|
backup.bodyType = temp.bodyType
|
||||||
|
|
||||||
if (
|
|
||||||
index === (this.snake.length - 1) &&
|
|
||||||
body.bodyType === GameLib.CustomCode.BODY_TYPE_CORNER
|
|
||||||
) {
|
|
||||||
// body.bodyType = GameLib.CustomCode.BODY_TYPE_TAIL;
|
|
||||||
//
|
|
||||||
// body.mesh.geometry = null;
|
|
||||||
//
|
|
||||||
// body.mesh.materials = null;
|
|
||||||
//
|
|
||||||
// body.mesh.remove();
|
|
||||||
//
|
|
||||||
// body.mesh = body.backupMesh;
|
|
||||||
//
|
|
||||||
// body.backupMesh = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body.applyToMesh();
|
body.applyToMesh();
|
||||||
|
|
Loading…
Reference in New Issue