UPDATE: Figured it out for a line.
If I want to have the user draw a line so an object bounces off of it. Can a display LINE be added as a static physics body? The APIs states physics.addBody allows you to turn any Corona display object into a simulated physical object with one line of code, including the assignment of physical properties.
Assume for this post that there is only 1 line.
In this code fragment the line is displayed but physics objects just pass through. Here is the basic code fragment:
line = display.newLine( line1x, line1y, line2x, line2y );
line:setColor( 255, 102, 102, 255 );
line.width = 5;
physics.addBody( line, "static", { density=20, friction=0.1, bounce=0.0 } );
When I try to remove the line physics body I get this error:
physics.removeBody() given a display object that is not a physics object
physics.removeBody(line );
Suggestions? [import]uid: 156018 topic_id: 35680 reply_id: 335680[/import]