You are previewing Cocos2d for iPhone 1 Game Development Cookbook.
O'Reilly logo
Cocos2d for iPhone 1 Game Development Cookbook

Book Description

"

Over 100 recipes for iOS 2D game development using cocos2d

  • Discover advanced Cocos2d, OpenGL ES, and iOS techniques spanning all areas of the game development process

  • Learn how to create top-down isometric games, side-scrolling platformers, and games with realistic lighting

  • Full of fun and engaging recipes with modular libraries that can be plugged into your project

In Detail

Cocos2d for iPhone is a robust but simple-to-use 2D game framework for iPhone. It is easy to use, fast, flexible, free, and Appstore approved. More than 2500 AppStore games already use it, including many best-seller 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 100 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.

"

Table of Contents

  1. Cocos2d for iPhone 1 Game Development Cookbook
    1. Cocos2d for iPhone 1 Game Development Cookbook
    2. Credits
    3. About the Author
    4. About the Reviewers
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    7. 1. Graphics
      1. Introduction
      2. Drawing sprites
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Coloring sprites
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Animating sprites
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. Drawing OpenGL primitives
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Playing video files
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Grid, particle, and motion streak effects
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Using Retina Display mode
        1. Getting ready
        2. How to do it...
        3. How it works...
      9. 1D and 2D Ease Actions
        1. Getting ready
        2. How to do it...
        3. How it works...
      10. Rendering and texturing 3D shapes
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      11. Rendering a texture-filled polygon
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      12. Animating a texture-filled polygon
        1. Getting ready
        2. How to do it...
        3. How it works...
      13. Swapping palettes using layers
        1. Getting ready
        2. How to do it...
        3. How it works...
      14. Swapping palettes using CCTexture2DMutable
        1. Getting ready
        2. How to do it...
        3. How it works...
      15. Using AWTextureFilter for blur and font shadows
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      16. Taking and using screenshots
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      17. Using CCParallaxNode
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      18. Lighting using glColorMask
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    8. 2. User Input
      1. Introduction
      2. Tap, hold, and drag input
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also...
      3. Depth testing input
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Creating buttons
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Creating a directional pad
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Creating an analog stick
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Using the accelerometer for steering
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Using the accelerometer for 3D rotation
        1. Getting ready
        2. How to do it...
        3. How it works...
      9. Pinch zooming
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      10. Performing gestures
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    9. 3. Files and Data
      1. Introduction
      2. Reading PLIST data files
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Reading JSON data files
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Reading XML data files
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also...
      5. Saving simple data using NSUserDefaults
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also...
      6. Archiving objects into archive files
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Mutating nested metadata
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Saving data into a PLIST file
        1. Getting ready
        2. How to do it...
        3. How it works...
      9. Saving data into an SQLite database
        1. Getting ready
        2. How to do it...
        3. How it works...
      10. Saving data using Core Data
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
    10. 4. Physics
      1. Introduction
      2. Box2D setup and debug drawing
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Creating collision response routines
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's More...
      4. Using different shapes
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Dragging and collision filtering
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Manipulating physical properties
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Applying impulses
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Applying forces
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also...
      9. Asynchronous body destruction
        1. Getting ready
        2. How to do it...
        3. How it works...
      10. Using joints
        1. Getting ready
        2. How to do it...
        3. How it works...
      11. Creating a vehicle
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's More...
      12. Character movement
        1. Getting ready
        2. How to do it...
        3. How it works...
      13. Simulating bullets
        1. Getting ready
        2. How to do it...
        3. How it works...
      14. Simulating and rendering a rope
        1. Getting ready
        2. How to do it...
        3. How it works...
      15. Creating a top-down isometric game engine
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's More...
    11. 5. Scenes and Menus
      1. Introduction
      2. Switching scenes
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Transitioning between scenes
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      4. Using CCLayerMultiplex
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Using CCLabel
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Using CCMenu
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Creating shadowed menu labels
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's More...
      8. UIKit alert dialogs
        1. Getting ready
        2. How to do it...
        3. How it works...
      9. Wrapping UIKit
        1. Getting ready
        2. How to do it...
        3. How it works...
      10. Creating draggable menu windows
        1. Getting ready
        2. How to do it...
        3. How it works...
      11. Creating a horizontal scrollable menu
        1. Getting ready
        2. How to do it...
        3. How it works...
      12. Creating a vertical sliding menu grid
        1. Getting ready
        2. How to do it...
        3. How it works...
      13. Creating a loading screen with an indicator
        1. Getting ready
        2. How to do it...
        3. How it works...
      14. Creating a minimap
        1. Getting ready
        2. How to do it...
        3. How it works...
    12. 6. Audio
      1. Introduction
      2. Playing sounds and music
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's More...
      3. Modifying audio properties
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's More...
      4. Fading sounds and music
        1. Getting ready
        2. How to do it...
        3. How it works...
      5. Using audio in a game
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      6. Using positional audio in a game
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Metering background music
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Metering dialogue for animation
        1. Getting ready
        2. How to do it...
        3. How it works...
      9. Streaming audio
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      10. Recording audio
        1. Getting ready
        2. How to do it...
        3. How it works...
      11. Using the iPod music library
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      12. Creating a MIDI synthesizer
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      13. Speech recognition and text-to-speech
        1. Getting ready
        2. How to do it...
        3. How it works...
    13. 7. AI and Logic
      1. Introduction
      2. Processing AI waypoints
        1. Getting ready
        2. How to do it...
        3. How it works...
      3. Firing projectiles at moving targets
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. AI line of sight
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. AI flocking using Boids
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. A* pathfinding on a grid
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      7. A* pathfinding in a Box2D world
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      8. A* pathfinding on a TMX tilemap
        1. Getting ready
        2. How to do it...
        3. How it works...
      9. A* pathfinding in a side-scroller
        1. Getting ready
        2. How to do it...
        3. How it works...
      10. Running a Lua script
        1. Getting ready
        2. How to do it...
        3. How it works...
      11. Dynamically loading Lua scripts
        1. Getting ready
        2. How to do it...
        3. How it works...
      12. Using Lua for dialogue trees
        1. Getting ready
        2. How to do it...
        3. How it works...
    14. 8. Tips, Tools, and Ports
      1. Introduction
      2. Accessing the Cocos2d-iPhone testbed
        1. Getting ready
        2. How to do it...
        3. How it works...
          1. Box2D testbed
      3. Packing textures using Zwoptex
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also...
      4. Creating levels using Tiled
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also...
      5. Creating levels using JSONWorldBuilder
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Creating scenes with CocosBuilder
        1. Getting ready
        2. How to do it...
        3. How it works...
      7. Using Cocos2d-X
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Using Cocos3d
        1. Getting ready
        2. How to do it...
        3. How it works...
      9. Releasing your app
        1. Getting ready
        2. How to do it...