look here
http://developer.anscamobile.com/content/game-edition-collision-detection
this should work:
[lua]local plane = display.newImage( “plane.png”, 100, 200 )
physics.addBody( plane, { density = 1.0, friction = 0.3, bounce = 0.2 } )
plane.id = “the plane”
local ground = display.newImage( “ground.png”, 160, 420 )
physics.addBody( ground, { density = 0 } )
ground.id = “the ground”
local function onCollision( event )
if ( event.phase == “began” ) then
print( "began: " … event.object1.id … " & " … event.object2.id )
if((event.object1.id==“the plane” and event.object2.id==“the ground”) or (event.object1.id==“the ground” and event.object2.id==“the plane”)) then
– do some landing stuff
end if
elseif ( event.phase == “ended” ) then
print( "ended: " … event.object1.id … " & " … event.object2.id )
end
end
Runtime:addEventListener( “collision”, onCollision )[/lua]
of course you could just check x,y positions [import]uid: 6645 topic_id: 3414 reply_id: 10265[/import]