From 39b8b0e92c1afa36532990810ff51331f6f543dc Mon Sep 17 00:00:00 2001 From: Skyball2000 Date: Wed, 29 Mar 2023 16:29:46 +0200 Subject: [PATCH] Fixed crash on last level --- project/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/project/main.py b/project/main.py index 64d16b8..36633ff 100644 --- a/project/main.py +++ b/project/main.py @@ -105,7 +105,11 @@ class MainLoop: def player_success(self, level: Level): next_level = self.parsed_levels_manager.find_next_level(level) - self.select_level(next_level) + if next_level is not None: + self.select_level(next_level) + else: + print('WINNNNNN!!') + self.select_main_menu() def select_main_menu(self): self.set_game_state(self.GAME_STATE_MENU)