26 lines
463 B
Lua
26 lines
463 B
Lua
|
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
|