2
\$\begingroup\$

Does the physics.addBody() only work with Circles and Rectangles? Or is it possible to physics.addBody() on vector shapes or sprites or with masks or something?

\$\endgroup\$
2
\$\begingroup\$

It works with more than just circles and rectangles. To be more specific,

[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.

The full explanation, along with examples including a rectangle, circle, and polygon, can be found here.

\$\endgroup\$
1
\$\begingroup\$

If you want an irregular physics object, you have to specify the x and y coordinates of the physic body. Complicated, but possible.

Or you can use a third-party tool like PhysicsEditor.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.