From 39b8b0e92c1afa36532990810ff51331f6f543dc Mon Sep 17 00:00:00 2001 From: Skyball2000 Date: Wed, 29 Mar 2023 16:29:46 +0200 Subject: [PATCH 1/3] 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) From ab04fe298573a7902ed2d687925b0554670c75d7 Mon Sep 17 00:00:00 2001 From: Erenando Date: Wed, 29 Mar 2023 16:34:37 +0200 Subject: [PATCH 2/3] Vacuum Cleaner has no collision anymore. Added deadly zone for it when sparkling --- project/level/elements/static/VacuumCleanerElement.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/project/level/elements/static/VacuumCleanerElement.py b/project/level/elements/static/VacuumCleanerElement.py index ab1b486..387c13c 100644 --- a/project/level/elements/static/VacuumCleanerElement.py +++ b/project/level/elements/static/VacuumCleanerElement.py @@ -18,11 +18,15 @@ class VacuumCleanerElement(StaticLevelElement): self.danger = True self.danger_time = 30 self.off_time = 50 + self.is_collider = False def tick(self, tick_data: TickData): super().tick(tick_data) self.animation_state_counter += tick_data.dt if self.danger: + for collision in self.get_collides_with(): + if collision.secondary_sprite.id == 'player': + self.level_screen_manager.player_death() if self.animation_state_counter >= self.danger_time: self.set_animation_state('off') self.animation_state_counter = 0 @@ -37,5 +41,4 @@ class VacuumCleanerElement(StaticLevelElement): block_type = BLOCK_TYPES[self.tile['name']] self.spritesheet = spritesheet_manager.get_sheet(block_type) self.set_animation_state('on') - self.position_scale.position = self.tile['position'] From bc43bf3a54dfd55f9bbb44ce724f09a9d61be6c2 Mon Sep 17 00:00:00 2001 From: Fabian Hoppe Date: Wed, 29 Mar 2023 16:36:26 +0200 Subject: [PATCH 3/3] increase delay of esc in levels --- project/level/selection/LevelScreenManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/level/selection/LevelScreenManager.py b/project/level/selection/LevelScreenManager.py index 66234aa..f8ef26a 100644 --- a/project/level/selection/LevelScreenManager.py +++ b/project/level/selection/LevelScreenManager.py @@ -31,7 +31,7 @@ class LevelScreenManager(ScreenManager): def tick(self, tick_data: TickData): if tick_data.key_manager.is_keymap_down(KeyManager.KEY_ESCAPE): self.main_loop.select_level_selection(self.level.theme) - pygame.time.delay(100) + pygame.time.delay(200) def player_death(self): self.main_loop.player_death(self.level)