Book Image

Cocos2d Game Development Blueprints

By : Jorge Jordán
Book Image

Cocos2d Game Development Blueprints

By: Jorge Jordán

Overview of this book

Table of Contents (15 chapters)
Cocos2d Game Development Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Initializing the game


In the code files of this chapter, you will find JumpAndRun_init.zip, which includes an initial project that we will use as the basis for the rest of the chapter.

We are not going to see the classes in depth, but let's take a look at the most important things so you understand the rest of the development process.

The game that we are going to develop is a platform game starring our old Yeti friend, who after escaping from the killer snowballs must climb some snow platforms to avoid falling into the abyss. That's why there are three different classes besides GameScene: Yeti, Floor, and Platform.

If you open Yeti.h, you will see that it derives from CCNode and that we have defined the following enumeration:

typedef enum {
    yetiStill = 0,
    yetiRunning,
    yetiJumping,
    yetiFalling
} YetiStates;

We will use this to keep control of the different states the Yeti could adopt. As you can see, our character will have run and jump actions and will be still or falling into...