From ebc3c130ed4d8ee6c44fc902bc4ee955799d1ac5 Mon Sep 17 00:00:00 2001 From: BoredGuy Date: Fri, 13 Dec 2024 16:22:39 +0300 Subject: Initial Commit --- Week1-Pacman/src/animation.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Week1-Pacman/src/animation.h (limited to 'Week1-Pacman/src/animation.h') diff --git a/Week1-Pacman/src/animation.h b/Week1-Pacman/src/animation.h new file mode 100644 index 0000000..795b6c7 --- /dev/null +++ b/Week1-Pacman/src/animation.h @@ -0,0 +1,29 @@ +#ifndef ANIMATION_H_ +#define ANIMATION_H_ + +#include +#include + +struct animation_init { + int initial_frame_count; + + float* initial_frame_times; + SDL_Rect* initial_frames; +}; + +struct animation { + int num_frames; + + int current_frame; + float current_time; + + float* frame_times; + SDL_Rect* frames; +}; + +void init_animation(struct animation* animation, + struct animation_init* init); +void update_animation(struct animation* animation, float dt); +void free_animation(struct animation* animation); + +#endif // ANIMATION_H_ -- cgit v1.2.3