From 7859709ac3b1500e3037c5dceacb77bcff778e89 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Mon, 30 Mar 2026 17:50:02 -0400 Subject: Read frame durations from aseprite files --- src/sprite.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sprite.lua') diff --git a/src/sprite.lua b/src/sprite.lua index b790a9e..0048b9f 100644 --- a/src/sprite.lua +++ b/src/sprite.lua @@ -47,11 +47,12 @@ end) function sprite_anim_sys(ent, dt) local sprite = ent.sprite local tag = sprite.anim.tags[sprite.active_tag] + local frame_duration = sprite.anim.frame_durations[sprite.frame] sprite.timer = sprite.timer + dt - if sprite.timer > tag.duration then + if sprite.timer > frame_duration then sprite.frame = sprite.frame + 1 - sprite.timer = 0 + sprite.timer = sprite.timer - frame_duration end if sprite.frame >= tag.to then -- cgit v1.3-2-g0d8e