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

O'Reilly logo
Learn cocos2D Game Development with iOS 5

Book Description

Learn cocos2d Game Development with iOS 5 provides a rock-solid introduction to the cocos2d iPhone and iPad game apps engine and related tools. It focuses on the process of creating several game apps made entirely using cocos2d with little or no use of the iOS 5 SDK and OpenGL code. By creating 2-3 sample game apps while working through the book, you'll learn key concepts of the cocos2d game engine and relevant tools like Zwoptex (TextureAtlas), ParticleDesigner (particle effects), and others.

The example games are modeled after popular App Store games, so they're relevant, recognizable, and immediately fun and inspiring. The games increase in complexity and highlight common questions for cocos2d beginners. As you advance, you'll learn how to successfully avoid common stumbling blocks. You'll also encounter general game programming wisdom, tips for performance improvement, as well as pointers for alternative implementations and further reading.

It is assumed that the reader has previous programming knowledge, though not necessarily with Objective-C. Related topics such as Xcode, Objective-C 2.0, the iOS 5 SDK, and OpenGL are only discussed where absolutely necessary. This book also features new related tools, including the new Kobold2D project.

Table of Contents

  1. Title
  2. Dedication
  3. Contents at a Glance
  4. Contents
  5. About the Authors
  6. About the Technical Reviewer
  7. Acknowledgments
  8. Preface
  9. Chapter 1: Introduction
    1. What’s New in the Second Edition?
    2. Why Use cocos2d for iOS?
    3. The Future of the cocos2d-iphone Project
    4. Other cocos2d Game Engines
    5. This Book Is for You
    6. Prerequisites
    7. What You Will Learn
    8. What’s in This Book
    9. Questions and Feedback
  10. Chapter 2: Getting Started
    1. What You Need to Get Started
    2. The HelloWorld Application
    3. Memory Management with cocos2d
    4. Changing the World
    5. What Else You Should Know
    6. Summary
  11. Chapter 3: Essentials
    1. The cocos2d Scene Graph
    2. The CCNode Class Hierarchy
    3. CCNode
    4. Director, Scenes, and Layers
    5. CCSprite
    6. CCLabelTTF
    7. Menus
    8. Actions
    9. A Note on Singletons in cocos2d
    10. Cocos2d Test Cases
    11. Summary
  12. Chapter 4: Your First Game
    1. Step-by-Step Project Setup
    2. Adding the Player Sprite
    3. Accelerometer Input
    4. First Test Run
    5. Player Velocity
    6. Adding Obstacles
    7. Collision Detection
    8. Labels and Bitmap Fonts
    9. Simply Playing Audio
    10. Porting to iPad
    11. Summary
  13. Chapter 5: Game Building Blocks
    1. Working with Multiple Scenes
    2. Working with Multiple Layers
    3. Subclassing Game Objects from CCSprite
    4. Composing Game Objects Using CCSprite
    5. Curiously Cool CCNode Classes
    6. Summary
  14. Chapter 6: Sprites In-Depth
    1. Retina Display
    2. CCSpriteBatchNode
    3. Sprite Animations the Hard Way
    4. Animation Helper Category
    5. Working with Texture Atlases
    6. Summary
  15. Chapter 7: Scrolling with Joy
    1. Advanced Parallax Scrolling
    2. A Virtual Joypad
    3. Summary
  16. Chapter 8: Shoot 'emUp
    1. Adding the BulletCache Class
    2. What About Enemies?
    3. The Entity Class Hierarchy
    4. Shooting Things
    5. A Healthbar for the Boss
    6. Summary
  17. Chapter 9: Particle Effects
    1. Example Particle Effects
    2. Creating a Particle Effect the Hard Way
    3. Particle Designer
    4. Shoot 'em Up with Particle Effects
    5. Summary
  18. Chapter 10: Working with Tilemaps
    1. What Is a Tilemap?
    2. Preparing Images with TexturePacker
    3. Tiled (Qt) Map Editor
    4. Using Orthogonal Tilemaps with Cocos2d
    5. Summary
  19. Chapter 11: Isometric Tilemaps
    1. Designing Isometric Tile Graphics
    2. Isometric Tilemap Editing with Tiled
    3. Isometric Game Programming
    4. Adding More Content to the Game
    5. Summary
  20. Chapter 12: Physics Engines
    1. Basic Concepts of Physics Engines
    2. Limitations of Physics Engines
    3. The Showdown: Box2D vs. Chipmunk
    4. Box2D
    5. Chipmunk
    6. Summary
  21. Chapter 13: Pinball Game
    1. Shapes: Convex and Counterclockwise
    2. Working with PhysicsEditor
    3. Programming the Pinball Game
    4. Summary
  22. Chapter 14: Game Center
    1. Enabling Game Center
    2. Game Kit Programming
    3. Summary
  23. Chapter 15: Cocos2d with UIKit Views
    1. What Is Cocoa Touch?
    2. Using Cocoa Touch and cocos2d Together
    3. Alert: Your First UIKit View in cocos2d
    4. Embedding UIKit Views in a cocos2d App
    5. Embedding the cocos2d View in Cocoa Touch Apps
    6. Summary
  24. Chapter 16: Kobold2D Introduction
    1. Benefits of Using Kobold2D
    2. The Kobold2D Workspace
    3. The Hello Kobold2D Template Project
    4. Doodle Drop for Mac with KKInput
    5. Entering the Third Dimension with cocos3d
    6. Summary
  25. Chapter 17: Out of the Ordinary
    1. Additional Resources for Learning and Working
    2. The Business of Making Games
    3. Summary
  26. Index