Game Development Reference
Now you may be wondering, what if I want two separate targets for iPhone and iPad?
This can be useful to charge different prices for iPhone and iPad versions or simply to
reduce the download size of either version.
In that case, all you have to do is to select the target—DoodleDrop in this case—and
choose Edit Duplicate. Or just right-click the target and select Duplicate. This cre-
ates a duplicate of the target, which allows you to set one target's Devices setting to
iPhone and the other target's Devices setting to iPad. Now you have a separate target
for each device type, and you might want to rename both targets and their schemes ac-
cordingly to avoid confusion.
I hope you had fun building this first game. It was surely a lot to take in, but I'd rather
err on the side of too much information than too little.
At this point, you've learned how to create your own game-layer class and how to
work with sprites. You've used the accelerometer to control the player and added velo-
city to allow the player sprite to accelerate and decelerate, giving it a more dynamic
Simple radial collision detection using the distance check method from the likewise un-
documented CGPointExtensions was also on the menu. And for dessert you had a
potpourri of labels, bitmap fonts, and the Glyph Designer tool, garnished with some au-
What's left? Maybe going through the source code for this chapter. I've added a final-
ized version of this game that includes some game-play improvements, a startup menu,
and a game-over message.
There's just one thing about the DoodleDrop project I haven't mentioned yet: it's all in
one class. For a small project, this may suffice, but it'll quickly get messy as you move
on to implement more features. You need to add some structure to your code design.
The next chapter will arm you with cocos2d programming best practices, show you
how to lay out your code, and discuss the various ways you can pass information
between objects if they're no longer in the same class.