ecs #58

Merged
raphael merged 70 commits from ecs into main 2023-11-03 15:29:36 +00:00
Showing only changes of commit 2b53fd46d3 - Show all commits

View file

@ -85,6 +85,15 @@ def __update_animations(world: World) -> None:
del entity[Animation] del entity[Animation]
animation.ended = True 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 # Et on appelle la fonction de callback
animation.callback(world, entity) animation.callback(world, entity)
else: else: