ecs #58
|
@ -85,6 +85,15 @@ def __update_animations(world: World) -> None:
|
|||
del entity[Animation]
|
||||
animation.ended = True
|
||||
|
||||
# On trouve la dernière image de l'animation et on met à jour la texture
|
||||
while texture is assets.error_texture:
|
||||
frame_index -= 1
|
||||
texture = assets.get_texture(f"{animation.name}/{frame_index:04d}")
|
||||
if frame_index < 0:
|
||||
break
|
||||
if texture is not assets.error_texture:
|
||||
__update_sprite(entity, texture, assets)
|
||||
|
||||
# Et on appelle la fonction de callback
|
||||
animation.callback(world, entity)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue