Added ghost image files. /JL
This commit is contained in:
5
maze.py
5
maze.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user