diff --git a/assets/story/boss_fight/death.mp3 b/assets/story/boss_fight/death.mp3 new file mode 100644 index 0000000..22092c6 Binary files /dev/null and b/assets/story/boss_fight/death.mp3 differ diff --git a/src/scenes/story/boss_fight.py b/src/scenes/story/boss_fight.py index 4cbdbe0..25ddfec 100644 --- a/src/scenes/story/boss_fight.py +++ b/src/scenes/story/boss_fight.py @@ -17,6 +17,7 @@ from plugins.inputs import Held, MousePosition from plugins.render import Sprite from plugins.assets import Assets from plugins.coroutine import condition, wait, Coroutine +from plugins.sound import Sound from plugins.timing import Delta, TimedEvent @@ -189,6 +190,8 @@ def __move(world: World): """ TODO """ + if IsRunning not in world: + return held = world[Held] s_pos = world[ShieldPos] for entity in world.query(Sprite, Velocity): @@ -259,6 +262,8 @@ def __check_hurt(world: World): """ TODO """ + if IsRunning not in world: + return for entity in world.query(Hurt, Sprite): position = entity.get(Sprite).position width, height = entity.get(Sprite).texture.get_size() @@ -321,9 +326,21 @@ def __defeat(world: World): """ TODO """ - if world[Life] <= 0: + if world[Life] <= 0 and IsRunning in world: world.remove(IsRunning) - world[CurrentScene] = __new_game_scene() + for entity in world.query(Player): + print("ANIMATIONS") + entity.set( + Animation( + "explosion", + 24, + ), + Sound(world[Assets].get_sound("death")), + ) + entity.remove(smooth.Target) + for entity in world.query(without=(Player,)): + entity.destroy() + world.new_entity().set(Sprite(world[Assets].get_texture("background"))) def __wave(world: World):