O'Reilly logo

Learn iPhone and iPad cocos2d 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 8. Shoot 'em Up

What does a game of this kind need above all else? Something to shoot up and bullets to evade. In this chapter you'll be adding enemies to the game and even a boss monster.

Both enemies and player will use the new BulletCache class to shoot a variety of bullets from the same pool. The cache class reuses inactive bullets to avoid constantly allocating and releasing bullets from memory. Likewise, enemies will use their own EnemyCache class because they, too, will appear in greater numbers on the screen.

Obviously the player will be able to shoot these enemies. I will also introduce the concept of component-based programming, which allows you to extend the game's actors in a modular way. Besides shooting and moving components, ...

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