From ef6abc27cec35e32acef66c5077ffcc6bedde983 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Mon, 3 Nov 2025 00:43:42 +0200 Subject: feat: move on keydown alternative, som tutorial levels --- Game.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Game.py') diff --git a/Game.py b/Game.py index 59d410a..af9b233 100644 --- a/Game.py +++ b/Game.py @@ -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(): -- cgit v1.2.3