From 730d92b7c3f4c54c678460ea776d9cc2bc7780f2 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Thu, 22 Mar 2018 15:47:20 +0100 Subject: [PATCH] Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 69 bytes modified --- 21g30t1e75.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/21g30t1e75.js b/21g30t1e75.js index ceabea4..65ce48f 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -915,9 +915,15 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { backup.orientation = body.orientation; backup.flip = body.flip; + } + + if (this.state.eating === true) { + body.applyToMesh(); + return; + } - } else { - + if (index > 0) { + temp = { position : { x : body.position.x, @@ -927,8 +933,6 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { flip : body.flip } - if (!this.state.eating) { - /** * Create a new empty object at the current grid position (free it up) */ @@ -941,14 +945,13 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { body.position.y = backup.position.y; body.orientation = backup.orientation; body.flip = backup.flip; - } - + /** * Update the grid with our new body */ this.grid[body.position.x][body.position.y] = body; - if (body.backupMesh && !this.state.eating) { + if (body.backupMesh) { /** * We used to be a corner, change back * @type {null}