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    4

Physics & Collisions

In this chapter, you’ll learn more about editing physics properties with SpriteBuilder and how to control the player through physics rather than actions. You’ll add impenetrable physics bodies as level borders to prevent the player character from moving outside the level boundaries.

You’ll also learn about how to run code when a collision occurs—in this case, to trigger game events like ending the current level—and how to set up collision categories and masks to allow certain physics bodies to pass through each other.

Player Physics

In the previous chapter, you already added a Physics node to the Level1.ccb and made the player node a child of the newly introduced Physics node. This instance of CCPhysicsNode ...

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