diff options
| author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-11-03 00:43:42 +0200 |
|---|---|---|
| committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-11-03 00:43:42 +0200 |
| commit | ef6abc27cec35e32acef66c5077ffcc6bedde983 (patch) | |
| tree | 62a867394c9b5af5eeff4873e12f776f2ef6b41c /Game.py | |
| parent | 1475dd4020ec24df8b29f5d90d89843b64f93f95 (diff) | |
| download | SnakePuzzle-ef6abc27cec35e32acef66c5077ffcc6bedde983.tar.gz SnakePuzzle-ef6abc27cec35e32acef66c5077ffcc6bedde983.zip | |
feat: move on keydown alternative, som tutorial levels
Diffstat (limited to 'Game.py')
| -rw-r--r-- | Game.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -109,13 +109,13 @@ class Game: return (pos in self.snake.cells) or (pos in map(lambda box: box.pos, self.boxes)) def tick(self): - lastSnakeCell = self.snake.cells[len(self.snake.cells) - 1] + self.snake.move() + + lastSnakeCell = self.snake.cells[0]#[len(self.snake.cells) - 1] if (lastSnakeCell.x < 0 or lastSnakeCell.x >= self.width()) or (lastSnakeCell.y < 0 or lastSnakeCell.y >= self.height()): self.nextLevel() return - self.snake.move() - for static in self.statics: match static: case PressurePlate(): |
