Help with Multiple Transitions

Hi All,

I have the following code which is meant to take pieces of a game board and have them fly in separately and come together to form the board.  However, every once in a while a few pieces do not seem to make it.  It is not all of the time, but when it happens it breaks the game board.  I can reload the screen and then they’ll all be there.  Here is the code:

function M.showGameBoard(init) &nbsp; math.randomseed(os.clock()) &nbsp; if init == true then &nbsp; &nbsp; M.element = 1 &nbsp; else &nbsp; &nbsp; M.element = M.element+1 &nbsp; end &nbsp; if M.element \<= M.gameGroup.numChildren then &nbsp; &nbsp; transition.from(M.gameGroup[M.element], &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; time=1000, &nbsp; &nbsp; &nbsp; &nbsp; alpha=0, &nbsp; &nbsp; &nbsp; &nbsp; x=math.random(1,myData.screenW), &nbsp; &nbsp; &nbsp; &nbsp; y=math.random(1,myData.screenH), &nbsp; &nbsp; &nbsp; &nbsp; transition=easing.inOutElastic &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; ) &nbsp; &nbsp; M.showGameBoard() &nbsp; end end

I’ve been using Lua/Corona for only about a month now, so it is most likely operator error :slight_smile:  I’m sure there is a better way to do this.  I have all of the elements in a group (gameGroup) and basically iterate through each one setting a transition on it.  There can be a few hundred of these elements.

When it works it looks exactly how I want it to :slight_smile:

Any help or pointers would be appreciated.