Hi, i was wondering if there was a way to implement a pause function into this code so if someone press’s the button it will stop spawning these objects in this code:
local function trackCircles(obj)
obj:removeSelf();
end
local function spawnCircle()
local Circle = display.newCircle( 10, -100, 30 )
Circle:setReferencePoint(display.TopReferencePoint);
Circle.name = "snow"
physics.addBody(Circle, "dynamic")
function Circle:touch(e)
if(e.phase == "ended") then
trackCircles(obj);
end
return true;
end
Circle:addEventListener("touch", Circle)
end
tmr = timer.performWithDelay(500, spawnCircle, 20000);
Thanks. [import]uid: 69054 topic_id: 18781 reply_id: 318781[/import]


[import]uid: 74676 topic_id: 18781 reply_id: 72354[/import]