diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2023-05-08 23:18:26 +0300 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2023-05-08 23:18:26 +0300 |
| commit | 5b2e6b7e660865b6db9bfb61e1b1d0fecc536858 (patch) | |
| tree | c559cf0ffe2b524982aec1f93ec2c1dae29eeeb9 /src/pinky.py | |
| parent | aaf0194f9b5d93bd6612bc0b419c4b8f89b4aa21 (diff) | |
| download | Macpan-5b2e6b7e660865b6db9bfb61e1b1d0fecc536858.tar.xz Macpan-5b2e6b7e660865b6db9bfb61e1b1d0fecc536858.zip | |
Added EatenMode
Diffstat (limited to 'src/pinky.py')
| -rw-r--r-- | src/pinky.py | 6 |
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) |
