-1

I making a puzzle game and I get a problem when I try to move sprite to a new position by using SKAction moveTo.

Here is my case:

I have 4 sprites in list and I want to move them to new position by putting them in for loop and using moveTo action. But moveTo cannot move the sprite immediately, it need to wait until the loop finished to move the sprite. And the problem is I use the sprite positions as a condition to stop the loop. ( for example: if sprite position reach to limit constant it cannot be moved anymore and the loop will be break)

My question: Do we have any way to make the sprite move immediately inside loop ?? Or do you know any better way to solve my case?

Any help will be appreciated.

Thank you.

4

1 回答 1

0

for使用重复计时器代替循环。当计时器触发时,移动您的精灵并测试是否使计时器无效(而不是退出循环)。

于 2013-11-03T13:38:32.913 回答