O'Reilly logo

Learn cocos2d 2: Game Development for iOS by Andreas Löw, 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    13

Pinball Game

I’d like to put the Box2D physics engine to good use, so in this chapter you’ll be making an actual pinball game. Pinball tables are all about using our physical world and turning that into a fun experience. With a physics engine, however, you’re not just limited to real-world physics.

You can create some elements of the pinball table, such as bumpers and balls, by simply choosing the right balance of friction, restitution, and density. Other elements need joints to work—a revolute joint for the flippers and a prismatic joint for the plunger. And of course, you need lots of static shapes that define the collision polygons of the table.

Because it would be impractical to define collision polygons in source code, at ...

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