Free Sample
+ Collection

Cocos2d for iPhone 1 Game Development Cookbook

Cookbook
Nathan Burba

Over 90 recipes for iOS 2D game development using cocos2d with this book and ebook
$29.99
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849514002
Paperback446 pages

About This Book

  • 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

Who This Book Is For

If you want to elevate your basic Cocos2d project to the next level, this is the book for you. Some understanding of Objective-C and Cocos2d is recommended. People with some programming experience may also find this book useful.

Table of Contents

Chapter 1: Graphics
Introduction
Drawing sprites
Coloring sprites
Animating sprites
Drawing OpenGL primitives
Playing video files
Grid, particle, and motion streak effects
Using Retina Display mode
1D and 2D Ease Actions
Rendering and texturing 3D shapes
Rendering a texture-filled polygon
Animating a texture-filled polygon
Swapping palettes using layers
Swapping palettes using CCTexture2DMutable
Using AWTextureFilter for blur and font shadows
Taking and using screenshots
Using CCParallaxNode
Lighting using glColorMask
Chapter 2: User Input
Introduction
Tap, hold, and drag input
Depth testing input
Creating buttons
Creating a directional pad
Creating an analog stick
Using the accelerometer for steering
Using the accelerometer for 3D rotation
Pinch zooming
Performing gestures
Chapter 3: Files and Data
Introduction
Reading PLIST data files
Reading JSON data files
Reading XML data files
Saving simple data using NSUserDefaults
Archiving objects into archive files
Mutating nested metadata
Saving data into a PLIST file
Saving data into an SQLite database
Saving data using Core Data
Chapter 4: Physics
Introduction
Box2D setup and debug drawing
Creating collision response routines
Using different shapes
Dragging and collision filtering
Manipulating physical properties
Applying impulses
Applying forces
Asynchronous body destruction
Using joints
Creating a vehicle
Character movement
Simulating bullets
Simulating and rendering a rope
Creating a top-down isometric game engine
Chapter 5: Scenes and Menus
Introduction
Switching scenes
Transitioning between scenes
Using CCLayerMultiplex
Using CCLabel
Using CCMenu
Creating shadowed menu labels
UIKit alert dialogs
Wrapping UIKit
Creating draggable menu windows
Creating a horizontal scrollable menu
Creating a vertical sliding menu grid
Creating a loading screen with an indicator
Creating a minimap
Chapter 6: Audio
Introduction
Playing sounds and music
Modifying audio properties
Fading sounds and music
Using audio in a game
Using positional audio in a game
Metering background music
Metering dialogue for animation
Streaming audio
Recording audio
Using the iPod music library
Creating a MIDI synthesizer
Speech recognition and text-to-speech
Chapter 7: AI and Logic
Introduction
Processing AI waypoints
Firing projectiles at moving targets
AI line of sight
AI flocking using Boids
A* pathfinding on a grid
A* pathfinding in a Box2D world
A* pathfinding on a TMX tilemap
A* pathfinding in a side-scroller
Running a Lua script
Dynamically loading Lua scripts
Using Lua for dialogue trees
Chapter 8: Tips, Tools, and Ports
Introduction
Accessing the Cocos2d-iPhone testbed
Packing textures using Zwoptex
Creating levels using Tiled
Creating levels using JSONWorldBuilder
Creating scenes with CocosBuilder
Using Cocos2d-X
Using Cocos3d
Releasing your app

What You Will Learn

  • Render, manipulate, animate, and optimize Cocos2d sprites, primitives and particles
  • Learn advanced graphical techniques including 2D lighting, rendering textured polygons, and drawing 3D primitive shapes
  • Use third party libraries for data, networking, and more
  • Gain a deep understanding of the Box2D physics engine
  • Create multiplayer networked games and games with intelligent AI actors
  • Learn tips, tricks, and best practices used by professional game developers

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.

Authors

Read More