I’m working on a small puzzle game based on tangrams and I’m looking into the way the pieces could be made so that they don’t overlap.
I was thinking of using Box2d for the collision detection, since we’re talking about a rhomboid, several triangles and a square, I figured that might be the best course to take.
The pieces need to be textured as well and the player needs to be able to rotate them at will.
Is Box2d the best way to go about this, or am I missing something obvious which might make things simpler?
Box2d will do the job for you, but you can always code your own version of 2D triangle-triangle collision. There are plenty plenty plenty of tutorials out there, you can also add some optimisations if you have many triangles, like circle-circle collision.
Thanks. I’ll have a look at possibly making my own version since what I need is much simpler than what Box2d is capable of.
Although Box2d is handy in that it easily allows for moving shapes around, I also noticed that the shapes are rotating when you drag them along the screen; but that probably can be countered by setting the angular damping.