The idol is the main character in Totem Destroyer, we can't represent it with just a box, or the curse of the totem will persecute us forever.
I was thinking about something like the following figure:
This is what I call an idol, and this is what we are going to build with Box2D.
On the left-hand side, the outline of the bodies forming the idol, and on the right-hand side the finished idol silhouette.
The first thing you can see is that the idol is made by more than one body joined together to create a single, complex body. Remember Box2D only works with convex polygons. Unlike totem bricks, which are just single boxes stacked, we need to merge all the idol objects in some way.
Easy things first. We'll start with the vertical box that we already know how to build, and we are going to build it in the Main
function just after building the last totem brick.
public function Main() { world=new b2World(new b2Vec2(0,5),true); debugDraw(); brick(275,435,30,30); brick(365...