summaryrefslogtreecommitdiff
path: root/Game.py
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2025-11-03 00:43:42 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2025-11-03 00:43:42 +0200
commitef6abc27cec35e32acef66c5077ffcc6bedde983 (patch)
tree62a867394c9b5af5eeff4873e12f776f2ef6b41c /Game.py
parent1475dd4020ec24df8b29f5d90d89843b64f93f95 (diff)
downloadSnakePuzzle-ef6abc27cec35e32acef66c5077ffcc6bedde983.tar.gz
SnakePuzzle-ef6abc27cec35e32acef66c5077ffcc6bedde983.zip
feat: move on keydown alternative, som tutorial levels
Diffstat (limited to 'Game.py')
-rw-r--r--Game.py6
1 files changed, 3 insertions, 3 deletions
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():