Added ghost image files. /JL

This commit is contained in:
2025-04-20 21:30:23 +02:00
parent 97c06fd3cf
commit c95c755e3f
9 changed files with 67 additions and 26 deletions

View File

@@ -34,7 +34,7 @@ class Maze:
self.dots.add((x, y))
elif char == "*":
self.power_pellets.add((x, y))
elif char == "P":
elif char == "M":
self.pacman_start = (x * TILE_SIZE + TILE_SIZE // 2, y * TILE_SIZE + TILE_SIZE // 2 + 32)
self.pacman_location = (x, y)
@@ -62,6 +62,9 @@ class Maze:
def is_wall(self, x, y):
return self.tile_at(x, y) == "W"
def is_ghost_home(self, x, y):
return self.tile_at(x, y) == "H"
def collect_dot(self, x, y):
"""Mark a dot as collected. Return True if there was a dot or power pellet."""
pos = (x, y)