Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 937 bytes modified

beta.r3js.org
-=yb4f310 2018-03-15 15:17:44 +01:00
parent fdc8eb81f5
commit c17ed61661
1 changed files with 35 additions and 4 deletions

View File

@ -252,7 +252,7 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
},
orientation : body.orientation
}
body.advance(
this.state.orientation
);
@ -267,20 +267,51 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
},
orientation : body.orientation
}
body.position.x = backup.position.x;
body.position.y = backup.position.y;
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;
}
body.applyToMesh();
}.bind(this)
)
return;
}.bind(this);
/*