I'm making a game in Corona SDK which is like you get a balloon spawned and it will be falling down, and when you press that balloon it disappears and it should spawn another one and so on, I've managed to set up the first one so when you tap on it it gets destroyed, and I got a function that gets called when you tap on the balloon, here it is:
function onBalloonTap (event)
balloon:removeSelf()
audio.play(blingsound)
local balloon = display.newImageRect( "balloon.png", 128, 200 )
balloon.x, balloon.y = 160, -100
balloon.rotation = 10
physics.addBody(balloon, { density=1.0, friction=0.3, bounce=0.5 })
end
It works perfectly, and it spawns another balloon as you can see, but I can't tap on it or anything, I don't know how can I spawn another balloon so that everything that applies to the first applies to it.