Hi,
I schedule objects that need to appear on the screen at once by calling timer.performWithDelay several times, like this:
for i = 1, numOfFoodsToMakeForCurrentWave do if i == 1 then makeOneFoodObject ( Waves[waveCounter][currentWaveIndex].speed, Waves[waveCounter][currentWaveIndex].position) else local myclosure = function() return makeOneFoodObject ( Waves[waveCounter][currentWaveIndex].speed, Waves[waveCounter][currentWaveIndex].position) end local timerID = timer.performWithDelay( (i - 1) \* 500, myclosure, 1) table.insert(timerStash, timerID) end end
Problem is, sometimes timer.performWithDelay is acting messed up and makes two objects at the same time. This happens more on the simulator on windows than on device but happens.
It’s almost impossible for me to track as it happens randomly.
Any ideas?