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) math.randomseed(os.clock()) if init == true then M.element = 1 else M.element = M.element+1 end if M.element \<= M.gameGroup.numChildren then transition.from(M.gameGroup[M.element], { time=1000, alpha=0, x=math.random(1,myData.screenW), y=math.random(1,myData.screenH), transition=easing.inOutElastic } ) M.showGameBoard() end end
I’ve been using Lua/Corona for only about a month now, so it is most likely operator error 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
Any help or pointers would be appreciated.