Let's look at other body types.
Nothing additional needs to be done here.
Now that you understand what a static body does, let's change the type of the body to dynamic and see what it does.
We will change the body type to dynamic by changing the
body.type variable to dynamic, as follows:
body.type = CCPhysicsBodyTypeDynamic;
Now, we will run the game again. You will see that now the circle is green in color, and it falls through the bottom of the screen. The pink color signifies that it is a dynamic body.
If you don't see anything on the screen, make sure you have set the
debugDraw variable to
true again in the
However, how do you stop it from going offscreen? This is done ...