From fc3032135f4da3662d6b727c70f22049d6e09231 Mon Sep 17 00:00:00 2001 From: BoredGuy Date: Sat, 14 Dec 2024 12:08:02 +0300 Subject: Update - Finish animation system - Fix bug where leftward/upward movement was slightly faster than downward/forward movement --- Week1-Pacman/src/animation.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Week1-Pacman/src/animation.h') diff --git a/Week1-Pacman/src/animation.h b/Week1-Pacman/src/animation.h index f225142..e6c717a 100644 --- a/Week1-Pacman/src/animation.h +++ b/Week1-Pacman/src/animation.h @@ -10,6 +10,7 @@ struct animation_init { const char* spritesheet; int initial_frame_count; + float initial_angle; float* initial_frame_times; SDL_Rect* initial_frames; }; @@ -17,6 +18,7 @@ struct animation_init { struct animation { SDL_Texture* texture; int num_frames; + float angle; int current_frame; float current_time; @@ -30,7 +32,7 @@ void init_animation(struct animation* animation, void update_animation(struct animation* animation, float dt); void free_animation(struct animation* animation); void draw_animation(struct demo* demo, - struct animation* animation, - SDL_Rect* d_rect); + const struct animation* animation, + const SDL_Rect* d_rect); #endif // ANIMATION_H_ -- cgit v1.2.3