summaryrefslogtreecommitdiff
path: root/animation.lua
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-04-22 15:58:41 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-04-22 15:58:41 -0700
commit078eca583eec21d317e931c84db8f084bef4305d (patch)
tree76b303cdda70a87a5febaf57726d4f8779a387a3 /animation.lua
parent3555b9ff88c3872c8f2dd8a8ab02382e2a7d0cb2 (diff)
downloaddyl8-078eca583eec21d317e931c84db8f084bef4305d.tar.gz
dyl8-078eca583eec21d317e931c84db8f084bef4305d.zip
Snapshot
Diffstat (limited to 'animation.lua')
-rw-r--r--animation.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/animation.lua b/animation.lua
new file mode 100644
index 0000000..0f6fba6
--- /dev/null
+++ b/animation.lua
@@ -0,0 +1,8 @@
+function get_frame(anim, t, theta)
+ len = #anim.seq
+ frames_passed = (t / anim.dt)
+ idx = flr(1 + (frames_passed % len))
+ dspritey = 0
+ if theta == 1 then dspritey = 16 end
+ return anim.seq[idx] + dspritey
+end \ No newline at end of file