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 5. Game Building Blocks

The game DoodleDrop in the previous chapter was written to be easy to understand if you're new to cocos2d. If you're a more experienced developer, though, you probably noticed that there is no separation of code; everything is in just one file. Clearly, this doesn't scale and if you're going to make bigger, more exciting games than DoodleDrop, you'll have to find a suitable way to structure your code. Otherwise, you might end up with one class driving your game's logic. The code size can quickly grow to thousands of lines, making it hard to navigate and tempting to change anything from anywhere, very likely introducing subtle and hard to find bugs.

Each new project demands its own code design. In this chapter I'd ...

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