fortunes_foundation/animator.lua

26 lines
463 B
Lua
Raw Normal View History

2024-02-05 06:55:13 +00:00
animator=klass()
function animator:init()
self.operations={}
end
function animator:update()
while true do
if (#self.operations==0) return
local op=self.operations[1]
if op:update() then
return true
else
deli(self.operations,1)
end
end
end
function animator:idle()
return #self.operations==0
end
function animator:add(op)
add(self.operations,op)
end
function animator:draw()
for i=#self.operations,1,-1 do
self.operations[i]:draw()
end
end