Hello.
I've made a simple kids app where you generate simple shapes (square, circle, triangle and rectangle) by clicking on buttons.
There is no point to it just the fun of tossing around different shapes.
I'm using box2d for physics which is very nice, but I've come across a problem when trying to make one of the shapes, triangles, magnetic.
Never having used box2d before I didn't know where to begin, but I started out by checking all triangles and using "SetSpritePhysicsForce" where the vector points to a shape for the magnet to be drawn towards. I then used a weld joint to join them until the magnetsprite was clicked.
This however didn't prove very practical, it was hard making a weld joint as the shapes weren't necessarily lined up right, which causes funny jumps in the game.
My next idea is to create dummy sprites on surfaces suitable for attaching on each shape and thereby being able to line them up better. But I worry about performance with this.
I'm open to suggestions, what would be the common way of doing this with a physics engine? Any input is appreciated
If need be I can upload the app but this isn't code specific, it's more implementation of general thinking around a problem
Thanks
My hovercraft is full of eels