Game Development Reference
In-Depth Information
Figure 10-17 . The player's texture is stretched to encompass the entire collision shape (4x scale)
There's, of course, room for improvement here. For instance, if you want to make the soft-
body player about the same size as the rigid-body player as before, you could try to do so.
This won't be as easy as it sounds, though. You'd have to decrease the circumference bod-
ies' radius, which in turn would increase the likelihood of the body getting stuck in other,
small collision shapes, such as chain and rope segments.
Nevertheless, don't allow me to prevent you from doing so. Just be prepared for lots and
lots of tweaking, experimenting, and even failing every so often. It's a good idea to make
backup copies of the player every now and then using Finder (or once SpriteBuilder has a
“duplicate CCB” feature, use that). Creating reliable soft-body physics takes time, sweat,
nerves, and everything else you can spare. The results (shown in Figure 10-18 ) are well
worth the effort!
Figure 10-18 . I have a mouth, and I must grin no matter how much it hurts
Summary
This chapter taught you the basic principles behind creating soft-body objects. It's essen-
tially just the right combination of spring and distance joints. There's lots of room for ex-
perimentation to achieve different kinds of soft bodies. It's also fun to experiment with
Search WWH ::




Custom Search