Beginner in CoronaSDK, just know how to use math.random to display the object. Want to learn how to spawn a set of 5 objects in ascending order.
local bubbles = {} local bubblesCounter = 0 local function tapBubbles (event) local obj = event.target if (event.phase == "began") then audio.play(popSound) display.remove( obj ) end end local function sendBubbles() local differentbubbles = {"images/bubbles/red1.png","images/bubbles/yellow1.png","images/bubbles/blue1.png", "images/bubbles/green1.png","images/bubbles/purple1.png"} local r = math.random( 1, #differentbubbles ) bubbles[bubblesCounter] = display.newImageRect( sceneGroup, differentbubbles[r], 82, 82 ) bubbles[bubblesCounter]:addEventListener( "touch", tapBubbles ) bubbles[bubblesCounter].x = math.random (42,278) bubbles[bubblesCounter].y = -40 physics.addBody( bubbles[bubblesCounter], "dynamic", {radius= 39}) transition.to( bubbles[bubblesCounter],{y =472, time=10000, onComplete=function(self) if (self~=nil) then display.remove(self) end end}) end timer.performWithDelay( 2000, sendBubbles, 5)