Système d'animations #22
33
src/engine/plugins/animation.py
Normal file
33
src/engine/plugins/animation.py
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
"""
|
||||||
|
Définit un plugin qui permet d'afficher des animations.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from engine import *
|
||||||
|
|
||||||
|
|
||||||
|
class AnimationPlugin(Plugin):
|
||||||
|
"""
|
||||||
|
Plugin qui permet d'afficher des animations.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def apply(self, game: Game) -> None:
|
||||||
|
"""
|
||||||
|
Applique le plugin a un jeu.
|
||||||
|
|
||||||
|
Paramètres:
|
||||||
|
game: Le jeu auquel appliquer le plugin.
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class AnimatedSprite:
|
||||||
|
"""
|
||||||
|
Composant qui represente un sprite animé.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self, images_folder: str, frame_count: int, frame_duration: float
|
||||||
|
) -> None:
|
||||||
|
self.images_folder = images_folder
|
||||||
|
self.frame_count = frame_count
|
||||||
|
self.frame_duration = frame_duration
|
Loading…
Reference in a new issue