diff options
| author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-11-04 22:30:28 +0200 |
|---|---|---|
| committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-11-04 22:30:28 +0200 |
| commit | 50db52d03bc08313c736c754ab0f908ab90086e3 (patch) | |
| tree | 291b17e0a48e806b8e05853f2be3c80ecbf23c02 /Snake.py | |
| parent | a60a1403b7335719ceca18c745ff663bd6852e94 (diff) | |
| download | SnakePuzzle-master.tar.gz SnakePuzzle-master.zip | |
Diffstat (limited to 'Snake.py')
| -rw-r--r-- | Snake.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -6,16 +6,16 @@ import Game class Snake: - def __init__(self, cells: list[Vec2], game: "Game.Game") -> None: + def __init__(self, cells: list[Vec2], level: "Game.Level") -> None: self.heading = Vec.up self.hasCollided = False self.cells = cells - self.game = game + self.level = level def move(self) -> None: nextPos = self.cells[0] + self.heading last = self.cells.pop() - if self.game.enter(nextPos, self.heading): + if self.level.enter(nextPos, self.heading): self.cells.insert(0, nextPos) else: self.cells.append(last) |
