Merge branch 'boss-fight' of https://git.tipragot.fr/raphael/gtn into boss-fight

This commit is contained in:
Raphaël 2023-11-05 19:11:04 +01:00
commit 341aa987da

View file

@ -328,8 +328,14 @@ def __defeat(world: World):
""" """
if world[Life] <= 0 and IsRunning in world: if world[Life] <= 0 and IsRunning in world:
world.remove(IsRunning) 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): for entity in world.query(Player):
print("ANIMATIONS")
entity.set( entity.set(
Animation( Animation(
"explosion", "explosion",
@ -337,9 +343,6 @@ def __defeat(world: World):
), ),
Sound(world[Assets].get_sound("death")), 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"))) world.new_entity().set(Sprite(world[Assets].get_texture("background")))