I have a spawner like so.
local myCircles = {} local function spawnCircle() local myCircle = display.newRect(enemyGroup,20,20,20,20 ) myCircle.x = math.random(W1\*0.2, W1\*0.8) myCircle:setFillColor(128/255,128/255,128/255) myCircle.y = math.random(H1\*-0.8, H1\*-0.2) physics.addBody(myCircle,"dynamic",{radius=5,bounce=1}) transition.to(myCircle,{time=999999,rotation=math.random(-99999,99999)}) myCircles[#myCircles+1] = myCircle end circlespawning=timer.performWithDelay(200,spawnCircle,200) speeditup = function (event) circlespawning=timer.performWithDelay(150,spawnCircle,0) end timer.performWithDelay(40000,speeditup) ------------------ local function remover() for i = #myCircles, 1, -1 do local myCircle = myCircles[i] if myCircle ~= nil then if myCircle.y \> H1\*0.7 then print(my.name) display.remove(myCircle) myCircles[i] = nil end end end end Runtime:addEventListener("enterFrame",remover)
How can I have these spawned circles ignore colliding with themselves?