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

@ -272,6 +272,37 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
body.position.y = backup.position.y; body.position.y = backup.position.y;
body.orientation = backup.orientation; 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; backup = temp;
} }
@ -280,7 +311,7 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) {
}.bind(this) }.bind(this)
) )
return;
}.bind(this); }.bind(this);
/* /*