aboutsummaryrefslogtreecommitdiff
path: root/src/inky.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/inky.py')
-rw-r--r--src/inky.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/inky.py b/src/inky.py
index 2b48ede..be2e62c 100644
--- a/src/inky.py
+++ b/src/inky.py
@@ -76,7 +76,7 @@ class Inky(Ghost):
rand_pos = (0, 0)
- 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)
@@ -101,6 +101,10 @@ class Inky(Ghost):
elif self.mode == MODE.CHASING:
ret[i] = self.heuristic(
(nx, ny), target[0], target[1])
+ elif self.mode == MODE.EATEN:
+ pos = self.get_intial_tile()
+ self.x = pos[0]
+ self.y = pos[1]
min_h = min(ret)