Hi
I have some questions regarding collisions.
In my app I'm making groupds of objects, one of these objects is seonsor which is responsible for collision detection. here is the example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | local wallObj = display.newGroup() local picWall = externParams.uiutils.getThemeItemName( theme_id, wall_id ) wallObj.wall = display.newImage( picWall, true ) wallObj.sensor = display.newImage( "sensor.png" ) --sensor.alpha = 0 wallObj.sensor.type = wall_id wallObj.sensor.obj = wallObj wallObj.sensor.y = wallObj.wall.y + wallObj.wall.height / 2 - wallObj.sensor.height / 2 wallObj:insert( wallObj.wall ) wallObj:insert( wallObj.sensor ) wallObj:setReferencePoint( display.CenterReferencePoint ) physics.addBody( wallObj.sensor, "static" ) |