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/inky.py | |
| parent | aaf0194f9b5d93bd6612bc0b419c4b8f89b4aa21 (diff) | |
| download | Macpan-5b2e6b7e660865b6db9bfb61e1b1d0fecc536858.tar.xz Macpan-5b2e6b7e660865b6db9bfb61e1b1d0fecc536858.zip | |
Added EatenMode
Diffstat (limited to 'src/inky.py')
| -rw-r--r-- | src/inky.py | 6 |
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) |
