Hey Guys
I am now working on a small academic project, I would like to know how can I monitor the x y position of the falling physical object.
let say there are three square( the following codes). How can I monitor the x y position of square a b c so that some effect will be trigger when they pass through the bottom line.
[lua]physics= require( “physics”)
physics.start( )
physics.setGravity( 0, 5 )
e=50
a= display.newRect( 50, 50, 50, 50 )
a.x=50
a.y=100
b= display.newRect( 70, 70, 70, 70 )
b.x=120
by=100
c= display.newRect( 100, 100, 100, 100 )
c.x=220
c.y=100
local greenCollisionFilter = { groupIndex = -2 }
physics.addBody(a,“dynamic”,{density=0,friction=0,bounce=0,shape={-e,-e,e,-e,e,e,-e,e},filter=greenCollisionFilter})
physics.addBody(b,“dynamic”,{density=0,friction=0,bounce=0,shape={-e,-e,e,-e,e,e,-e,e},filter=greenCollisionFilter})
physics.addBody(c,“dynamic”,{density=0,friction=0,bounce=0,shape={-e,-e,e,-e,e,e,-e,e},filter=greenCollisionFilter})
z=display.newRect(5,470,320,5);
z.anchorX=0
z.anchorY=0
physics.addBody(z,“static”,{density=0,friction=0,bounce=0,shape={-e,-e,e,-e,e,e,-e,e},filter=greenCollisionFilter}) --left[/lua]