aboutsummaryrefslogtreecommitdiff
path: root/src/game_state.py
diff options
context:
space:
mode:
authoromagdy7 <omar.professional8777@gmail.com>2023-05-08 23:02:03 +0300
committeromagdy7 <omar.professional8777@gmail.com>2023-05-08 23:02:03 +0300
commitaaf0194f9b5d93bd6612bc0b419c4b8f89b4aa21 (patch)
tree5c8950e0cb7adb4782e35bb26a0aa8242ea71398 /src/game_state.py
parent241e41892a10d3913c63935a8f9e14306e8a73cd (diff)
downloadMacpan-aaf0194f9b5d93bd6612bc0b419c4b8f89b4aa21.tar.xz
Macpan-aaf0194f9b5d93bd6612bc0b419c4b8f89b4aa21.zip
Added a simple Wining screen when the user collects all the food
Diffstat (limited to 'src/game_state.py')
-rw-r--r--src/game_state.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/game_state.py b/src/game_state.py
index f722873..5ed98c0 100644
--- a/src/game_state.py
+++ b/src/game_state.py
@@ -26,7 +26,9 @@ class GameState():
self.clyde = Clyde(sprites[4], 14 * TILE_WIDTH +
15, 12 * TILE_HEIGHT + 15)
self.map = Map.Map()
+ self.food = 0
self.game_over = False
+ self.score = 0
self.is_pacman_alive = True
def reset(self, sprites):
@@ -40,7 +42,9 @@ class GameState():
self.clyde = Clyde(sprites[4], 14 * TILE_WIDTH +
15, 12 * TILE_HEIGHT + 15)
self.map = Map.Map()
+ self.food = 0
self.game_over = False
self.is_pacman_alive = True
+ self.score = 0
timer_event = pygame.USEREVENT + 1
pygame.time.set_timer(timer_event, 1000 * 10, 1)