Hi Mike,
This is not the actual code, but what I am trying to achieve. The for loop might be flawed, but the point here is how to have events run synchronously one after the other.
look at this example to understand what I am trying to do
local movecharacter = function(posx,posy, sprite)
--moves the sprite passed to x,y
transition.to (sprite, {x=posx, y=posy, time=500})
end
now, I want to call this to do the following
movecharacter(x1co,y1co, player1)
movecharacter(x2co,y2co, player2)
movecharacter(x3co,y3co, player3)
movecharacter(x4co,y4co, player4)
what I was trying to create with the for is that it is not always known how many players are selected, so in pseud-code it was a for loop iterator
for player in players
movecharacter(xco, yco, player)
end
the question here is how can I achieve that first player1 moves, then player2 moves then player3 and then player4. At the moment, on running this, they all move at the same time.
cheers,
Jayant C Varma [import]uid: 3826 topic_id: 3077 reply_id: 9033[/import]