PacktLib: Creating Games with cocos2d for iPhone 2

Creating Games with cocos2d for iPhone 2


About the Author

About the Reviewers


Thanks for the Memory Game

The project is...

Let's build a menu

We need sprites

On to the playfield

The flow of the game

A stack of tiles

Adding interactivity

Scoring and excitement

Animating the score


Match 3 and Recursive Methods

The project is…

Basic gem interaction

Building the playfield

Checking for matches

Checking moves

Predictive logic

Artificial randomness


Thumping Moles for Fun

The project is…

Defining a molehill

Making a molehill

Mole spawning

Combining actions and animation

Touching moles

Tying it together


Give a Snake a Snack…

The project is…

Building a better snake

Moving the snake

Building the environment

Collisions and eating

Levels and difficulties

The main loop

But…how do we control the snake?


Brick Breaking Balls with Box2D

The project is…

Box2D – a primer

On to the game!

Setting everything in motion

Paddling around

Storing player data

Building bricks

Breaking bricks, for real

Power-ups, good and bad


Cycles of Light

The game is…

Design review

Let's build a bike

Building walls

Bike movement

Control buttons

Building the background grid

The playfield

Bluetooth multiplayer


Playing Pool, Old School

The game is…

Overall design

Building the table

Loading the rules

Rack 'em up

Player HUD

Collision handling

Building the control base

The rules engine

Putting balls back

Checking the table

The playfield init method


Shoot, Scroll, Shoot Again

The game is…

Design review

Tiled – a primer

Implementing the tilemap

Adding our hero

Controlling the hero with SneakyJoystick

Building the HUD

Scene construction

Tile helper methods

Smarter hero walking

Time for bullets

Building the enemy

Collision handling

Game over, man

Smarter enemies


Running and Running and Running...

The game is...

Design review

Building the ground

Parallax background

Our hero

Touch controls

Shooting bullets

Enemies everywhere

Collision handling