Book: Learn Cocos2D Game Development

First Edition

Xcode 3, iOS 4, Cocos2D v0.99, Zwoptex, VertexHelper, Hiero.

Learn iPhone and iPad Cocos2D Game Development book cover

Second Edition

Xcode 4, iOS 5, Cocos2D 1.0, TexturePacker, PhysicsEditor, Glyph Designer. NEW: UIKit Integration, Kobold2D & Cocos3D. Learn more.

Create compelling 2D games with Learn cocos2d Game Development with iOS 5. This book shows you how to use the powerful Cocos2D game engine to develop games for iPhone and iPad with tilemaps, virtual joypads, Game Center, and more.

Best of all, Learn cocos2d Game Development with iOS 5 will have you making games right from the very start. It guides you step-by-step through the creation of sample games. These fun examples are modeled after popular App Store games and teach you key concepts of the Cocos2D game engine and relevant tools like TexturePacker (texture atlas), PhysicsEditor (physics collision shapes), Particle Designer (particle effects), Glyph Designer (bitmap fonts), and others.

This book offers a rock-solid introduction to creating games made entirely with Cocos2D and little or no iOS 5 SDK and OpenGL code. It also details alternative implementations, identifies the best free and commercial tools for cocos2d game development, features coverage of the author’s improved Cocos2D game engine (Kobold2D), and even helps you enhance your game’s marketability on the App Store.

What you’ll learn

  • The process and best practices of mobile game development, including sprite batching, texture atlases, parallax scrolling, orthogonal and isometric tilemaps, bitmap fonts, touch and accelerometer input.
  • How to enhance your games using the Box2D and Chipmunk physics engines and other cocos2d-related tools and libraries.
  • How to add UIKit views to cocos2d and how to add cocos2d to UIKit apps.
  • The ins and outs of the Kobold2D development environment for cocos2d and its preconfigured libraries, including cocos3d and Lua.

Who this book is for

The book is aimed at beginning game developers looking for an easier and even more powerful way to create compelling 2D graphics using OpenGL and Objective-C. It is assumed that the reader will have some knowledge of object-oriented programming and the Apple and iPhone/iPad developer environment.

Table of Contents

  1. Introduction
  2. Getting Started
  3. Essentials
  4. Your First Game
  5. Game Building Blocks
  6. Sprites In-Depth
  7. Scrolling with Joy
  8. Shoot ’em Up
  9. Particle Effects
  10. Working with Tilemaps
  11. Isometric Tilemaps
  12. Physics Engines
  13. Pinball Game
  14. Game Center
  15. Cocos2D With UIKit Views (NEW in 2nd Edition)
  16. Kobold2D Introduction (NEW in 2nd Edition)
  17. Out of the Ordinary

Learn Cocos2D Book Reviews

Book Details

Book Resources

45 Responses to “Book: Learn Cocos2D Game Development”

  1. Young-Jin Lee says:
    Hi, I was trying to put a cocos2d app into a UIKit app by following the chapter 15 of your book. Although I followed the steps exactly, I got tons of errors from the Box2D codes. "Box2D/Collision/b2BroadPhase.h' file not found" is one of many errors I got when I tried to build the code. But, b2BroadPhase.h file is included under the lib folder that I added. Can you help me solve this problem? By the way, I am using Xcode v.4.3.1. and cocos2d 1.0.01. Thanks in advance.
    • Keep in mind that you need to add the Box2D folders to the Build Settings "Header Search Path". Do not use "User Header Search Path" though since Box2D headers (quite uncommonly) #include/#import headers with angle brackets (reserved for system headers) instead of quotes.
  2. Paul Masri says:
    Hi Steffen, Thanks for a great book, with a really readable style. Having got an app out there by writing pure Objective-C, I wish I'd come across libraries like cocos2d/kobold2d earlier. (Mind you it's still worth understanding the basics!) I have a couple of questions. In chapter 4 (2nd ed), you say "You can find these and other useful math functions in the CGPointExtension files in the cocos2d/Support group in the Xcode project." Sorry for being a bit dim but where do I find this cocos2d/Support group and these files? As you say, you've got a chapter about transitioning to Kobold2D, which I've read ahead of working through from the start, but all the code before that chapter is geared towards Cocos2D. When I came to download Cocos2D, I actually ended up with Kobold2D v1.0.1, so there are already some differences with the code in the book. What I'm wondering is: if Kobold2D is there to reduce the learning curve and deal with some logistical issues of Cocos2D, am I doing things the hard way by trying to learn Cocos2D and then transition? Cheers, Paul.
    • If you look in the cocos2d archive after extracting, the support files are in the /cocos2d-iphone-xxxx/cocos2d/support folder (xxx being the version number). Could be that in cocos2d 2.0 the path or filename have changed. You should still be able to locate it with spotlight searching for "drawcircle" or "drawpoly". Second question is a yes and no. The 2nd edition of the book will be harder to work with Kobold2D because there are some minor differences. In the next edition you'll be able to work with both and in numerous places I'll mention the things that Kobold2D users can either skip, or use instead because it's already built-in.
  3. chris baxter says:
    hi just working my through your book. its really good and thank you. I have a question on particle systems. Right now I have a particle effect created in Particle designer. a bit like the snow falling. (I tried using box2d , bu the perfomance got increasingly worse, but nice physics effect when spirites landed, shame). Anyway, as the particles hit the floor, i want to to built up the surface where they land to give the effect of snow building up. is there a way to retain particles, or at least determine where they land so i can add a small spite ? can you help me with this problem ?
    • The particles in a particle system can not be influenced at all other than with the parameters you can set in Particle Designer and code. They don't collide, you don't even have access to the position information for individual particles. For that to work you'd have to use a different approach. Like you said, animating individual sprites with a physics engine. But unless this is a central aspect of your game's design, it's not worth doing because it simply eats up too much performance. There are particle engines that can do that, but they're typically found only in high-end game engines for PC and consoles, and even there are sparsely used.

Leave a Reply