Review: Creating Games with cocos2d for iPhone 2

So as promised in our cocos2d survey a couple days back, we’ve been reading the latest from Packt,  Creating Games with cocos2d for iPhone 2:

9007OS_9007OS_Cocos2d for iPhone Hotshotcov.jpg.png

and why yes, we quite like the approach it takes. Most books we read go through pieces of a big project where the newbie finds themselves easily overwhelmed, or are snippets without a context so you need to be able to grasp their application on your own; what this one does is present nine complete but small enough to be easily graspable games of popular genres — and bundled them up to the App Store too, where you can check them out to see if you’re interested in seeing the code:

Pack 1 – Mole Thumper, Brick Breaker, Pool

Pack 2 – Memory, Match 3, Snake, Scrolling Shooter, Endless Runner

Pack 3 – Cycles of Light

The theory behind that is explained on the cocos2d blog here:

… Most developers learn the basics of cocos2d for iPhone v.2.0, and subsequently hit a wall. We have all these interesting classes that are really powerful, like CCLayer, CCSprite, actions, etc. How can we put these things together and make something equally interesting out of them?

That is the “gap” this book aims to fill. Rather than take the beginner’s book approach, where we spend several pages explaining what a sprite is, how it is drawn, etc. “Creating Games” skips many of the generalities and jumps right into the reason we are here: building games. This is the book I wished I had in hand when I was first exploring cocos2d for iPhone.

Class by class, method by method, the text explains the “good parts” of why we are building the code in this fashion. All the “good parts” are explained in detail: from building with Box2D to GameKit Bluetooth integration, and even how to build in “artificial randomness” into a Match 3 game, so you never run out of moves.

Each chapter is a complete game, and all source code is available as a download from the publisher’s web site. The games cover a wide variety of game types, and the games become more intricate and complex as the book progresses…

Can’t add to that really, except to observe that why yes the book is pretty much perfectly positioned to help cover that jump from reading the API to figuring out how to actually use it. So if you’re a complete newbie, we’d still recommend The iPhone Game Kit; but if you’ve got a bit of programming background but are new to cocos2d and/ot game programming, yep this is an excellent choice. Or if you’re interested in checking out the approach the author takes to the covered game genres, which are

  • Chapter 1: Memory
  • Chapter 2: Match 3
  • Chapter 3: Mole Thumper
  • Chapter 4: Snake
  • Chapter 5: Brick Breaker (with Box2D)
  • Chapter 6: Cycles of Light (iPad with Bluetooth integration)
  • Chapter 7: Pool (with Box2D)
  • Chapter 8: Scrolling Shooter (using Tiled)
  • Chapter 9: Endless Runner

One quibble you might have is that why isn’t v2.0 out of date already? Yep, but not by much, and download notes to bring it up to speed are on the author’s site. And while you’re there, check out the video. Definitely the best trailer we’ve ever seen for a programming book. (Pretty sure it’s the only trailer we’ve ever seen for a programming book, so the bar’s low there, but hey.)

So overall? Well, we like to reserve five stars for books that qualify as “absolutely essential fundamentals”, and it’s not quite that, but it is definitely a well done guide with far more coherence than you’ll find hunting down tutorials and samples on the web. Solid four stars, with the particular recommendation that if you find yourself in the position of being able to install cocos2d and run the samples but are having trouble gapping that over to getting started on your own game, this is the absolutely perfect book for you!

Alex | February 15, 2013

Leave a Reply