Book Image

Cocos2d-X Game Development Blueprints

By : Karan Sequeira
Book Image

Cocos2d-X Game Development Blueprints

By: Karan Sequeira

Overview of this book

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

Adding progression and difficulty levels


By now, we have a fully functioning game but we still haven't ensured the game is challenging and addictive for the user. We must engage the player by increasing the intensity and difficulty of the game progressively. In our previous game, we had the option of designing levels that get more difficult, but this game isn't level based and is different every time.

With that in mind, a bit of spice is added by creating a variety of formations in which the enemies will spawn on screen. These formations will be increasingly difficult with the difficulty completely based on how long the user has managed to survive. We define a few enums and constants in GameGlobals.h before writing the functions that will add progression to our game:

enum ESkillTimer
{
  E_SKILL1 = 10,
  E_SKILL2 = 30,
  E_SKILL3 = 45,
  E_SKILL4 = 60,
  E_SKILL5 = 90,
  E_SKILL6 = 120,
};

First up, we have an enum called ESkillTimer that represents the skill level in terms of the number of...