O'Reilly logo

Developing Mobile Games with Moai SDK by Francisco Tufro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Box2D body types

The whole point of using a physics engine is to create a world where you put objects (bodies) that behave according to physics laws. The term body is highly based on physics literature, where all the objects that interact are called bodies.

There are three types of bodies in Box2D: static, kinematic, and dynamic. They are explained as follows:

  • Static bodies: You can think of these as bodies that are fixed to the world. They don't move on their own, and they are not affected by gravity or collisions. Keep in mind that static bodies are able to collide with other objects, but they will not move or change as a result of the collision, just as the other objects (if they're not static). We'll use static bodies as platforms in our game, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required