From 74ce12a352524117be44f1b37cad73eb8f6635e2 Mon Sep 17 00:00:00 2001 From: Tipragot Date: Sun, 5 Nov 2023 19:16:59 +0100 Subject: [PATCH] Bye les jeuns --- src/scenes/story/boss_fight.py | 38 ++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/scenes/story/boss_fight.py b/src/scenes/story/boss_fight.py index cd69a1b..910ad46 100644 --- a/src/scenes/story/boss_fight.py +++ b/src/scenes/story/boss_fight.py @@ -326,24 +326,30 @@ def __defeat(world: World): """ TODO """ - if world[Life] <= 0 and IsRunning in world: - world.remove(IsRunning) - for entity in world.query(Coroutine): - entity.destroy() - for entity in world.query(smooth.Target): - entity.remove(smooth.Target) - for entity in world.query(Animation): - entity.remove(Animation) + if IsRunning in world: + if world[Life] <= 0: + world.remove(IsRunning) + for entity in world.query(Coroutine): + entity.destroy() + for entity in world.query(smooth.Target): + entity.remove(smooth.Target) + for entity in world.query(Animation): + entity.remove(Animation) - for entity in world.query(Player): - entity.set( - Animation( - "explosion", - 24, - ), - Sound(world[Assets].get_sound("death")), + for entity in world.query(Player): + entity.set( + Animation( + "explosion", + 24, + ), + Sound(world[Assets].get_sound("death")), + ) + world.new_entity().set( + Sprite(world[Assets].error_texture, order=20), + Animation("animation_bg_mort", 24), ) - world.new_entity().set(Sprite(world[Assets].get_texture("background"))) + elif len(world[Held]) > 0 and len(world.query(Animation)) == 0: + world[CurrentScene] = __new_game_scene() def __wave(world: World):