Game Development Reference
In-Depth Information
Figure 10-10 . All circumference nodes have been connected with distance joints
You should publish and run the game now. The player has already gained the necessary
coherence, yet it behaves more like a Hacky Sack. If you ever wanted to create a Hacky
Sack game, now you know how to do so. Otherwise, read on to learn how to make the
player behave more like a squishy ball.
Increasing the Player's Bounciness
There are two ways to proceed from here. It depends on what the result should feel like.
If you wanted to make an actual ball, like a basketball or a soccer ball, it might suffice to
add eight more distance joints. Each joint would connect the center body with one of the
circumference bodies and would have both the minimum and maximum distance enabled
and set to the same value. The Collide bodies property would be left unchecked because it
would be unlikely the ball would contract enough for circumference bodies to come in
contact with the center body. The result would be a bouncy ball that compresses while un-
der pressure.
However, you couldn't control the ball's bounciness when using only distance joints. The
fact that the distance joints even allow being compressed despite the minimum and max-
imum distance settings means you would be relying on a side effect of the physics en-
gine's implementation of the distance joint. That's never a good thing to do, as it can
change in future updates.
Search WWH ::




Custom Search