Hi,
I have a bunch of objects being spawned with physics and pushed onto the screen with a linear impulse.
Here’s how my objects are being spawed
local function spawnTorpedo() i = i + 1 torpedo[i] = display.newRect( 50, 100, 100, 50 ) torpedo[i].x = 0 torpedo[i].y = display.contentCenterY + math.random( 5 ) physics.addBody( torpedo[i], "dynamic", {density=.5, friction=1 } ) torpedo[i]:applyLinearImpulse( math.random(11), math.random(-3, 3), torpedo[i].x, torpedo[i].y ) torpedo[i]:addEventListener( "touch", physTouch ) torpedo[i]:addEventListener( "collision", inZone ) end timer.performWithDelay( 2000, spawnTorpedo, 0 )
Once the object is dragged into the zone, I want it to fade or shrink as if it was dropping into a hole. Right now my function inZone is trying to detect the collision between object[i] spawned and a rectangle without physics (the zone).
I’ve been stuck on this for a while, does anyone have any hints or ideas that can help me?
Thank you in advance.