Game Development Reference
In-Depth Information
cussing nodes with physics, I will use the term “body” synonymously for “node,” primar-
ily when the context refers to the physics properties and behavior of the node.
While you're on the Item Physics tab for the player, change the Physics shape to a circle
and give it a Corner radius of 32 points. Leave the other settings as they were, in particu-
lar the Dynamic setting should be selected. The settings should be the same as in Figure
4-1 .
Figure 4-1 . The player sprite's physics settings
Now you can have some fun: publish, build, and run the app. You'll notice the player im-
mediately starts falling due to physics-imposed gravity. Nevertheless, you can also tap the
screen to make the player move to that location. But you can't prevent the player from
continuously falling down ever faster. What's going on here?
Move and Rotate Actions Conflict with Physics
Internally, gravity accumulates and increases the body's velocity even while the node is
being moved by the move action. Eventually, the move action stops and physics takes
over again.
Search WWH ::




Custom Search