aboutsummaryrefslogtreecommitdiff
path: root/animation.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2023-05-04 10:15:19 +1000
committerquou <quou@disroot.org>2023-05-04 10:15:19 +1000
commitc4ac81cffcf925963acb0c02584ab22626427a73 (patch)
tree7d6421405e53a92baada909355c5398f21e91864 /animation.h
parentc4ee81da673208fe7b3e3638692fd466acf61c3f (diff)
Add an animation system.
Diffstat (limited to 'animation.h')
-rw-r--r--animation.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/animation.h b/animation.h
new file mode 100644
index 0000000..e9e1399
--- /dev/null
+++ b/animation.h
@@ -0,0 +1,22 @@
+#ifndef animation_h
+#define animation_h
+
+#include "config.h"
+#include "rect.h"
+
+typedef enum {
+ animation_player_walk_left = 0,
+ animation_player_walk_right,
+ animation_player_idle_left,
+ animation_player_idle_right
+} Animation_ID;
+
+typedef struct {
+ Rectangle frames[animation_max_frames];
+ int frame_count;
+ int slowness;
+} Animation;
+
+const Animation* get_animation(Animation_ID id);
+
+#endif