More small changes

This commit is contained in:
clb92
2016-07-06 04:15:13 +02:00
parent cede8d45cb
commit 1d1ccf30d7
3 changed files with 25 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ var Snake = function(game) {
}
}
Snake.prototype.changeDirection = function(direction = '') {
Snake.prototype.changeDirection = function(direction) {
if (direction !== '') {
switch (this.previousDirection) {
case ('up'):
@@ -91,6 +91,7 @@ Snake.prototype.move = function() {
}
this.locations.unshift([newX, newY]);
this.game.canvas.setTile('snake', this.locations[0][0], this.locations[0][1]);
}
}