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.