summaryrefslogtreecommitdiff
path: root/Week1-Pacman/src/animation.h
diff options
context:
space:
mode:
authorBoredGuy <osome3717@gmail.com>2024-12-14 12:08:02 +0300
committerBoredGuy <osome3717@gmail.com>2024-12-14 12:08:02 +0300
commitfc3032135f4da3662d6b727c70f22049d6e09231 (patch)
tree8e0caba74cc6749c76f211540fe908f6b9a3d476 /Week1-Pacman/src/animation.h
parent993f45cec7a08a5b980ef5a08ea7ce19b877b743 (diff)
Update
- Finish animation system - Fix bug where leftward/upward movement was slightly faster than downward/forward movement
Diffstat (limited to 'Week1-Pacman/src/animation.h')
-rw-r--r--Week1-Pacman/src/animation.h6
1 files changed, 4 insertions, 2 deletions
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_