summaryrefslogtreecommitdiff
path: root/animation.lua
blob: 0f6fba615ed713eeb99704d78dcf9dc11cd09e91 (plain) (blame)
1
2
3
4
5
6
7
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