Book Image

Cocos2d-x by Example: Beginner's Guide

By : Roger Engelbert
Book Image

Cocos2d-x by Example: Beginner's Guide

By: Roger Engelbert

Overview of this book

Table of Contents (19 chapters)
Cocos2d-x by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a tutorial to our game


Let's face it. With the possible exception of Air Hockey, every game so far in this book could benefit from a tutorial, or a "how to play" section. With Victorian Rush Hour, I'm going to show you a quick way to implement one.

The unspoken rule of game tutorials is—make it playable. And that's what we'll attempt to do here.

We'll create a game state for our tutorial, and we'll add a Label object to our stage and make it invisible unless the tutorial state is on. We'll use the Label object to display our tutorial text, as shown in the image here:

Let's go over the steps necessary to create our game tutorial.