Hello,
I’m converting a game to Corona, I was wondering how I should create several objects during a certain amount of time, from an image and with physics, currently I’m trying this:
local function spawnShapes()
circle = display.newImage( "assets/circle.png", math.random(10), math.random(20) )
circle.addBody( puck, {density=1, friction=1, bounce=0.5, rotation=5} )
end
local clockTimer = timer.performWithDelay( 1000, spawnShapes, -1 )
but it doesn’t work at all, I mean without physics it does, with physics it doesn’t.
I looked at the fishes example and maybe I should use groups but in the example it shows a fixed amount (10) while I need to spawn objects at fixed interval during the gameplay, they could be 10 they could be thousands.
Thanks.
Since we are here a quick couple of questions to avoid clogging the forums:
- Is it possible to resize an image after display.newImage
- Is corona going to apply a collision mask automatically or do I have to do it? [import]uid: 118481 topic_id: 21708 reply_id: 321708[/import]