All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
Credits
Author
Nathan Burba
Reviewers
Chris Cockcroft
Hai "EvilJack" Nguyen
Senior Acquisition Editor
Usha Iyer
Development Editor
Susmita Panda
Technical Editors
Priyanka Shah
Naheed Shaikh
Project Coordinator
Jovita Pinto
Proofreader
Aaron Nash
Indexer
Monica Ajmera Mehta
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
About the Author
Nathan Burba is a game developer, student, producer, and entrepreneur. He graduated from Ithaca College with a BA in Computer Science in 2008 and began working toward an MFA in Interactive Media at the University of Southern California School of Cinematic Arts in 2011. He founded Logical Extreme Studios LLC in 2011 and plans to release his first iOS game, Golden Age Baseball, in early 2012.
I would like to thank my family and friends for their constant support. In particular, I would like to thank my loving girlfriend Julie for her exuberant encouragement and unending patience. I would also like to thank my Computer Science peers and mentors throughout the years including, but not limited to, Zander Li, Joseph Blass, Alex Martinez, Ali Erkan, John Barr, Chris Ledet, George Smith, and Jared Combs. This book is a collection of recipes that hundreds of dedicated individuals have contributed to in one way or another. I'd like to thank Ricardo Quesada and those who've contributed directly to Cocos2d, Erin Catto and those who've contributed to Box2d, Cocos2d forum members: ascorbin, manucorporat, asinesio, Blue Ether, jbarron, Joao Caxaria, and BrandonReynolds, programmers: John W. Ratcliff, Ray Wenderlich, Gus Mueller, and Alex Eckermann, and Open Game Art contributors: artisticdude, p0ss, mrpoly and Bart K.
About the Reviewers
Chris Cockcroft has over 12 years of experience in the graphic design and illustration industry. He has more recently become involved in iOS interactive entertainment in both design and development roles. In addition to self-publishing several titles built around the Cocos2D frameworks, Chris also worked with developer Andreas Ehnbom on the visual design of the popular Cocos2D-driven (and Apple-featured) title, Fuji Leaves. Chris' work can be viewed at www.chriscockcroft.com.
Hai "EvilJack" Nguyen fits your typical engineering stereotype: scrawny, loves to program, and scared to death of women. He spends his free time tinkering with gadgets and updating his Facebook status.
After finishing graduate school at the University of Florida, Jack moved to Taiwan in mid 2003. Shortly thereafter SARS hit the Asia Pacific region (unrelated to Jack's arrival, of course). He then joined a software company that worked on mobile phones (Aplix) and got a chance to play with all the latest phones and gadgets.
Eventually, he left that awesome job and moved to Korea a few years later (to chase a girl) and spent the better part of a year studying Korean. Shortly after moving there, North Korea began conducting tests of their nuclear stockpile (unrelated to jack's arrival, of course).
Eventually, he moved back to the USA and began working for a voice over IP startup creating mobile applications for them. Shortly after moving back to the US (2007), the greatest financial crisis in almost a century occurred (unrelated to Jack's arrival, of course).
Jack currently splits his time between California and Florida while trying to avoid getting kicked out of (yet) another country. He is currently hiding away in his mother's basement writing iPhone apps.
www.PacktPub.com
Support files, eBooks, discount offers and more
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at > for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
Why Subscribe?
- Fully searchable across every book published by Packt
- Copy and paste, print and bookmark content
- On demand and accessible via web browser
Free Access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Preface
Cocos2d for iPhone is a robust but simple to use 2D game framework for iPhone. It is fast, flexible, free, and App Store approved. More than 2500 App Store games already use it, including many best-selling games. Do you want to take your Cocos2d game development skills to the next level and become more professional in Cocos2d game design?
Cocos2d for iPhone 1 Game Development Cookbook will help you reach that next level. You will find over 90 recipes here that explain everything from the drawing of a single sprite to AI pathfinding and advanced networking. Full working examples are emphasized.
Starting with the first chapter, Graphics , you will be taken through every major topic of game development. You will find both simple and complex recipes in the book.
Each recipe is either a solution to a common problem (playing video files, accelerometer steering) or a cool advanced technique (3D rendering, textured polygons).
This cookbook will have you creating professional quality iOS games quickly with its breadth of working example code.