sokoban.love/0058-draw_next_frames_of_an...

14 lines
363 B
Plaintext

-- update any in-progress animations
-- return whether any work remains
draw_next_frames_of_animations = function()
local a = Animations_in_progress
for i=#a,1,-1 do
if coroutine.status(a[i].co) == 'dead' then
table.remove(a, i)
else
local status, err = coroutine.resume(a[i].co)
if status == false then error(err) end
end
end
return #a > 0
end