diff --git a/21g30t1e75.js b/21g30t1e75.js index 13a88e7..191950a 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -139,7 +139,7 @@ GameLib.CustomCode.SnakeBody = function( this.mesh = mesh; this.applyPositionToMesh(); -}; +}.bind(this); GameLib.CustomCode.SnakeBody.prototype.clone = function() { return new GameLib.CustomCode.SnakeBody( @@ -186,9 +186,10 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { this.snake = this.snake.reduce( function(result, body, index) { + if ((index + 1) >= this.snake.length) { /** - * do nothing + * Do nothing */ } else { /**