我声明了两个这样的序列:
*rest of code for sprite sheet already written above*
sprite.add(sprite1,"eyes",1,7,500,1)
sprite.add(sprite1,"ears",8,13,500,1)
local instance = sprite.newSprite(sprite1)
instance.x = display.contentWidth/2
instance.y = display.contentHeight/2
然后我尝试像这样播放它们,每个之间有一些延迟:
local function move1()
instance:prepare("eyes")
instance:play()
end
local function move2()
instance:prepare("tails")
instance:play()
end
timer.performWithDelay(1000,move1,1)
timer.performWithDelay(2000,move2,1)
但这不起作用,因为一旦调用第二个函数, Sprite 就会从其原始位置移动。换句话说,它会消失几秒钟。最初,我以为它试图同时播放两个序列,但后来,我将其设置为仅循环一次,但它仍然给我带来这个问题。有人知道我该如何解决这个问题吗?谢谢。
最佳答案
关于coronasdk - 如何依次播放一个序列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10530128/