Book Image

Creating Games with cocos2d for iPhone 2

By : Paul Nygard
Book Image

Creating Games with cocos2d for iPhone 2

By: Paul Nygard

Overview of this book

Cocos2d for iPhone is a simple (but powerful) 2D framework that makes it easy to create games for the iPhone. There are thousands of games in the App Store already using cocos2d. Game development has never been this approachable and easy to get started. "Creating Games with cocos2d for iPhone 2" takes you through the entire process of designing and building nine complete games for the iPhone, iPod Touch, or iPad using cocos2d 2.0. The projects start simply and gradually increase in complexity, building on the lessons learned in previous chapters. Good design practices are emphasized throughout. From a simple match game to an endless runner, you will learn how to build a wide variety of game styles. You will learn how to implement animation, actions, create "artificial randomness", use the Box2D physics engine, create tile maps, and even use Bluetooth to play between two devices. "Creating games with cocos2d for iPhone 2" will take your game building skills to the next level.
Table of Contents (16 chapters)
Creating Games with cocos2d for iPhone 2
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The project is…


We will be building a Match 3 game in this chapter. This game is heavily influenced by several of the extremely popular games of the genre, but we will be sticking to core mechanics in this chapter. What is being left out? We will not be including any special modes for matching four or five gems in a row, though those matches will still be scored. We will explore one approach to avoiding a "no more moves" situation using predictive logic and artificial randomness. We will assume you have familiarity with the basic structural concepts from Chapter 1, Thanks for the Memory Game, so we will dive directly into the Match 3-specific code.

Note

We will be using classes with names such as MAMenuLayer, MAPlayfieldLayer, MAMenuScene, and MAPlayfieldScene throughout the book. The two-letter prefix will be different for each game (MT for Chapter 1, Thanks for the Memory Game, MA for this chapter, and so on), but the role each class plays will be the same. This structure is our foundational...