Chapter    10

Soft-Body Physics

In this chapter, you will change the player character from a rigid object to a soft-body physics object. A soft body is an object whose predetermined shape can bend and flex under the forces applied to it. If the body is also trying to relax back into its predetermined shape, it is often referred to as “jelly” physics—especially if the shape is easily deforming and altogether wobbly. That’s the kind of soft body you’ll create in this chapter.

Since a deformable body changes its shape, the texture (sprite) used to display the body needs to be deformed also. A regular CCSprite won’t do that, as skewing and scaling the texture alone won’t suffice. So in the second half of this chapter you’ll dive into Cocos2D’s rendering ...

Get Learn SpriteBuilder for iOS Game Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.