From be5c7263406aef867501c7965bcced6a7e2898a6 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Sep 2024 16:39:31 +1000 Subject: animation, player movement, physics etc. --- animation.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 animation.c (limited to 'animation.c') 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]; +} -- cgit v1.2.3-54-g00ecf