From 9963e94897ec8faac041fb3efc33b98eb80cbe96 Mon Sep 17 00:00:00 2001 From: Tipragot Date: Thu, 26 Oct 2023 19:45:58 +0200 Subject: [PATCH] Ajout du plugin d'animations --- src/engine/plugins/animation.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/engine/plugins/animation.py diff --git a/src/engine/plugins/animation.py b/src/engine/plugins/animation.py new file mode 100644 index 0000000..aab3cb3 --- /dev/null +++ b/src/engine/plugins/animation.py @@ -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