summaryrefslogtreecommitdiff
path: root/animation.lua
diff options
context:
space:
mode:
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