aboutsummaryrefslogtreecommitdiff
path: root/src/clyde.py
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-05-08 23:18:26 +0300
committeromagdy7 <omar.professional8777@gmail.com>2023-05-08 23:18:26 +0300
commit5b2e6b7e660865b6db9bfb61e1b1d0fecc536858 (patch)
treec559cf0ffe2b524982aec1f93ec2c1dae29eeeb9 /src/clyde.py
parentaaf0194f9b5d93bd6612bc0b419c4b8f89b4aa21 (diff)
downloadMacpan-5b2e6b7e660865b6db9bfb61e1b1d0fecc536858.tar.xz
Macpan-5b2e6b7e660865b6db9bfb61e1b1d0fecc536858.zip
Added EatenMode
Diffstat (limited to 'src/clyde.py')
-rw-r--r--src/clyde.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/clyde.py b/src/clyde.py
index 755eafd..2fd4aee 100644
--- a/src/clyde.py
+++ b/src/clyde.py
@@ -42,7 +42,7 @@ class Clyde(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)
@@ -77,7 +77,10 @@ class Clyde(Ghost):
if settings.debug:
pygame.draw.line(screen, self.color, (game_state.pacman.x, game_state.pacman.y),
(self.x, self.y), 1)
-
+ elif self.mode == MODE.EATEN:
+ pos = self.get_intial_tile()
+ self.x = pos[0]
+ self.y = pos[1]
min_h = min(ret)
# Favour going up when there is a conflict