aboutsummaryrefslogtreecommitdiff
path: root/src/pinky.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/pinky.py')
-rw-r--r--src/pinky.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pinky.py b/src/pinky.py
index 5f58f54..bb50c5b 100644
--- a/src/pinky.py
+++ b/src/pinky.py
@@ -70,7 +70,7 @@ class Pinky(Ghost):
new_target = self.get_four_tiles_ahead_of_pacman(game_state.pacman)
- if game_state.pacman.powerup:
+ if game_state.pacman.powerup and self.mode != MODE.EATEN:
self.mode = MODE.FRIGHETENED
rand_pos = random.randint(0, 900), random.randint(0, 990)
@@ -91,6 +91,10 @@ class Pinky(Ghost):
elif self.mode == MODE.CHASING:
ret[i] = self.heuristic(
(nx, ny), new_target[0], new_target[1])
+ elif self.mode == MODE.EATEN:
+ pos = self.get_intial_tile()
+ self.x = pos[0]
+ self.y = pos[1]
if settings.debug:
pygame.draw.line(screen, self.color, (new_target),
(self.x, self.y), 1)