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

Defining the properties of the tower


The basic characteristics of a tower can be summarized as follows:

  • It will have a specified range

  • It will fire at one or more enemies that enter its range

  • It will do one or more kinds of damage to its enemies

  • It will cost money to build or upgrade, and can be sold

Based on these characteristics, we shall define the following properties for a tower in our game:

  • Physical damage

  • Magical damage

  • Speed damage

  • Range of fire

  • Rate of fire

  • Cost to build

These properties are varied enough to build a simple yet interesting game. With the help of a skilled level designer, you can even make the player enjoy hours of satisfying gameplay.

Let's quickly take a look at the XML structure that is defined to accommodate the data for the towers in this game:

<TowerDataSetList>

  <TowerDataSet bullet_name="TD_bullet01.png" is_lightning="false" is_rotating="true">
    <TowerData sprite_name="TD_t01gun01.png" range="1.5" physical_damage="10" magical_damage="0" speed_damage...