math.randomseed(os.time())
local k=math.random(5)
print(k)
local num = numrandom()
-- ret:playBgMusic(num..".mp3")
local to,right,aa={},{},0
for o=1 , 3 do
to = cc.ProgressTo:create(5, 1000)
right = cc.ProgressTimer:create(cc.Sprite:create("bg_"..num.."_"..o..".png"))
right:setType(cc.PROGRESS_TIMER_TYPE_BAR)
-- Setup for a bar starting from the bottom since the midpoint is 0 for the y
right:setMidpoint(cc.p(0, 1))
-- Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
right:setBarChangeRate(cc.p(0, 1))
right:setPosition(128-(50*aa),160)
right:runAction(cc.RepeatForever:create(to))
d:addChild(right)
aa=aa+1
end
以上的for循环执行3次,载入三张图片,并各执行动画,问题是他们几乎是同时执行动画的,怎么样执行完一个再接着下一个?
或者for循环里加时间延迟,要怎么加?
谢谢