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

Developing a tutorial for our game


A tutorial is a scene where the background of the game, the controls, and other relevant information are explained for the player to understand how to play.

There are several ways to develop the tutorial of a game, it depends on the type of game. For example, a tutorial for Tetris will explain that the game consists of blocks of different shapes that will drop from the top of the screen, and which we can rotate to build full rows, while a tutorial for Grand Theft Auto will be similar to a small mission, where we will learn to shoot guns or drive cars.

Regardless of the genre of the game, one thing is clear: a tutorial is a state machine where each state is a step of the tutorial that we need to take in order to learn how the game works.

In our case, we will manage these states by defining an enumeration type that will consist of each of the steps we need to take to solve a given level.

Go to GameScene.h and add the following lines at the top of the file, just...