aboutsummaryrefslogtreecommitdiff
path: root/animation.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-09-29 16:39:31 +1000
committerquou <quou@disroot.org>2024-09-29 16:39:31 +1000
commitbe5c7263406aef867501c7965bcced6a7e2898a6 (patch)
tree1e7d5d3b435456c9eeb2d094c3288df259246750 /animation.c
parent9ca0a79e9cc784e14c3d8111ccb9ea1a22225472 (diff)
animation, player movement, physics etc.
Diffstat (limited to 'animation.c')
-rw-r--r--animation.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/animation.c b/animation.c
new file mode 100644
index 0000000..388e29d
--- /dev/null
+++ b/animation.c
@@ -0,0 +1,9 @@
+#include "animation.h"
+#include "rect.h"
+
+void update_anim(const Animation* a, int* f, Rect* r) {
+ f[0]++;
+ if (f[0] >= a->fc * a->s)
+ f[0] = 0;
+ *r = ((const Rect*)&a[1])[f[0] / a->s];
+}