Ajout de la mort :(

This commit is contained in:
Tipragot 2023-11-05 18:52:56 +01:00
parent ff5f8c9edd
commit 2c7bcc41cc
2 changed files with 19 additions and 2 deletions

Binary file not shown.

View file

@ -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):