def draw(x,y,z)
if @loop
@animObj[(Gosu::milliseconds / @speed % @animObj.size)].draw(x,y,z)
return true
else
if not @started
start=(Gosu::milliseconds / @speed % @animObj.size)
@started=true
@map=[]
i=0
start.upto(@animObj.size-1) { |index|
@map[index]=i
i+=1
}
if start-1>=0
0.upto(start-1) { |index|
@map[index]=i
i+=1
}
end
end
index=@map[(Gosu::milliseconds / @speed % @animObj.size)]
if not @done and index < @animObj.size - 1
@animObj[index].draw(x,y,z)
return true
else
@done=true
@animObj[@animObj.size - 1].draw(x,y,z)
return false
end
end
end