Hi everyone, I just have a question regarding for loops so I hope you guys can help me out.
Heres my code:
local function circleBall()
local circles = display.newCircle( math.random(0, 320), -20, 15 )
circles:setFillColor ( 27, 157, 0 )
physics.addBody ( circles, {density=1.0, bounce=0.8} )
timer.performWithDelay ( 1000, circles )
end
for i = 1, 10 do
circleBall()
end
My goal is to let the circle fall from the sky(it is) but I want to let it fall one by one using timer.performWithDelay and for loops, like fall down 1 by 1 per second until all the circles are done falling, but now it all falls at the same time, I mean all 10 circles fall together, can anyone tell me how to make the circles fall one by one? Im a bit new to corona but I hope I will master it someday.
thanks in advance to anyone who answers.