math.random() for times a function runs?

I’m working on a game that requires items to fall in a random sequence. The best thing I can come up with is [lua]timer.performWithDelay( math.random(1000), runFunction, 3000 )[/lua]

It seems that [lua]math.random[/lua] doesn’t work with [lua]timer.performWithDelay[/lua].

Is there a way to have it spawn objects randomly?

Please and thanks. :slight_smile: [import]uid: 25216 topic_id: 11750 reply_id: 311750[/import]

Check out how this person spawns enemies in gameLoop().

http://karnakgames.com/wp/2011/02/how-to-make-a-simple-physics-based-shooter-game-with-the-corona-sdk/ [import]uid: 58455 topic_id: 11750 reply_id: 42779[/import]