Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 909 bytes modified
parent
a8e9f5af91
commit
ac0610e7ab
|
@ -1036,6 +1036,28 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
|
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
|
|
||||||
|
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.backupMesh = null;
|
||||||
|
|
||||||
|
body.mesh.visible = true;
|
||||||
|
|
||||||
|
body.mesh.updateInstance('visible');
|
||||||
|
|
||||||
|
body.mesh.updateInstance('position');
|
||||||
|
}
|
||||||
|
|
||||||
backup = {
|
backup = {
|
||||||
position : {
|
position : {
|
||||||
x : body.position.x,
|
x : body.position.x,
|
||||||
|
@ -1063,6 +1085,16 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
|
||||||
|
|
||||||
switch (gameObject.objectType) {
|
switch (gameObject.objectType) {
|
||||||
case GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY :
|
case GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY :
|
||||||
|
|
||||||
|
if (body.orientation !== backup.orientation) {
|
||||||
|
body.orientation = backup.orientation;
|
||||||
|
body.flip = backup.flip;
|
||||||
|
backup.orientation = this.state.orientation;
|
||||||
|
backup.flip = this.state.flip;
|
||||||
|
this.createCorner(body, backup);
|
||||||
|
body.applyToMesh();
|
||||||
|
}
|
||||||
|
|
||||||
this.explode(body.position);
|
this.explode(body.position);
|
||||||
break;
|
break;
|
||||||
case GameLib.CustomCode.OBJECT_TYPE_FOOD :
|
case GameLib.CustomCode.OBJECT_TYPE_FOOD :
|
||||||
|
|
Loading…
Reference in New Issue