So the function below spawns dustbins. in
function spawnDustbin() i = 0 dustbin = {} i = i + 1 dustbin[i] = display.newImage("dustbin.png") dustbin[i].xScale = 0.55 dustbin[i].yScale = 0.55 dustbin[i].y = 555 dustbin[i].x = (math.random(1000,1100) \* i) dustbin[i].speed = 4 physics.addBody( dustbin[i], "static", { friction=1.0, density=1.0, bounce=0, radius=60} ) dustbin[i].enterFrame = moveDustbin Runtime:addEventListener("enterFrame", dustbin[i]) end
in enter scene the line:
timer.performWithDelay(1000, spawnDustbin, 14)
Calls the function but how do I remove the dustbins off the scene on exitscene all help welcome!
Thank you
James