O'Reilly logo

Learn SpriteBuilder for iOS Game Development by Steffen Itterheim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required