Hi
i am trying to spawn lots of objects same type same name just increment the name with 1 .
now how can i know exactly which object had been spawn and still on the screen and how can i access each one of them outside their function
see my code down
local Spawn5 = function () Object5= {} i=0 for i= 1,1 do Object5[i] = display.newSprite( sheet\_Object5, sequences\_Object5 ); Object5[i].y= 0 Object5[i].x = (math.random(screenLeft+10, screenRight-20)) sceneGroup:insert(Object5[i]) physics.addBody( Orange5Parts[i], "dynamic" ,{radius = 0, isSensor = true }) transition.to ( Orange5Parts[i], {time=5000,x=150,y=700,tag = "animationBlock" } ) Object5[i]:addEventListener( "collision", Object5Colide ) return Object5[i] end end
.