From d610718c10e310c75126593624ecaaaa2233b371 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Mon, 8 May 2023 20:08:41 +0300 Subject: Added a simple GameOver Screen --- src/ghost.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/ghost.py') diff --git a/src/ghost.py b/src/ghost.py index e785afc..e4b4cf1 100644 --- a/src/ghost.py +++ b/src/ghost.py @@ -108,9 +108,9 @@ class Ghost(): min_idx = ret.index(min_h) return min_idx - def move(self, maze, pacman, screen, game_over, blinky): + def move(self, maze, pacman, screen, is_pacman_alive, blinky): if abs(pacman.x - self.x) <= 15 and abs(pacman.y - self.y) <= 15: - game_over[0] = True + is_pacman_alive[0] = False min_idx = self.get_next_move(pacman, maze, screen, blinky) new_dx = dx[min_idx] * self.speed new_dy = dy[min_idx] * self.speed @@ -120,7 +120,6 @@ class Ghost(): self.last_move = min_idx def draw(self, screen, powerup, counter): - print(f"{self.color} -> mode: {self.mode}") radius = 30 // 2 pos = (self.x - radius, self.y - radius) if powerup: -- cgit v1.2.3