From 7664fdafb9a6d6f4aa3339fe38958b24b234218e Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 30 Sep 2024 19:01:53 +1000 Subject: player slashing --- animation.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'animation.c') diff --git a/animation.c b/animation.c index 388e29d..2010301 100644 --- a/animation.c +++ b/animation.c @@ -1,9 +1,13 @@ #include "animation.h" #include "rect.h" -void update_anim(const Animation* a, int* f, Rect* r) { +int update_anim(const Animation* a, int* f, Rect* r) { + int done = 0; f[0]++; - if (f[0] >= a->fc * a->s) + if (f[0] >= a->fc * a->s) { f[0] = 0; + done = 1; + } *r = ((const Rect*)&a[1])[f[0] / a->s]; + return done; } -- cgit v1.2.3-54-g00ecf