ajout de l'annimation quand on prend des degats

This commit is contained in:
CoCo_Sol 2023-11-04 22:57:44 +01:00
parent 1522fd9f79
commit 7e0898d848
2 changed files with 16 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View file

@ -96,6 +96,12 @@ class IsRunning:
"""
class Player:
"""
Composant qui represente le joueur.
"""
def __initialize_world(world: World):
"""
TODO
@ -121,6 +127,7 @@ def __initialize_world(world: World):
),
smooth.Target(world[ShieldPos]),
Velocity(500 * world[Delta]),
Player(),
)
@ -152,7 +159,15 @@ def __set_hurtable_hurt(world: World):
TODO
"""
world.set(Hurtable.FALSE)
yield wait(2)
for entity in world.query(Player):
for i in range(16):
yield wait(0.125)
if i % 2 == 1:
entity[Sprite].texture = world[Assets].get_texture("shield")
else:
entity[Sprite].texture = world[Assets].get_texture("hurt_shield")
world.set(Hurtable.TRUE)