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 this chapter, we are going to develop a game in which the player will advance through levels by providing the correct answer to mathematics problems.

Until now, we would think that the way to accomplish the loading and management of the different stages would be performed by having several classes derived from CCScene, but we can make it simpler and control all this behavior with just one class.

At the moment, let's initialize the first game level:

  1. Open the code files of this chapter.

  2. There you will find SqueezingBrains_init.zip which contains the initial project. Unzip this file.

  3. Open the Xcode project SqueezingBrains.xcodeproj to get started.

The project has nothing special to mention as it's a one-scene game that shows nothing at the moment. Let's remedy that.

We're going to load the background image, but before we can do that, we need to have the corresponding file available in the project:

  1. In the project navigator, select the Resources group.

  2. Right-click and select Add...