Chapter 3. Not Just a Space Game

After playing around a bit with Cocos2d-html5, it's finally time to get down and dirty with the good old C++ version of the engine. So, you will be using Cocos2d-x for this chapter and all the subsequent chapters. In this chapter, we will use actions for almost everything we need and get creative with some particle effects. You will also learn how to include progression in a game by creating a few levels.

We will cover the following topics in this chapter:

  • How to use the awesome Cocos2d-x project creator tool to create a cross-platform project
  • How to create a custom sprite by extending CCSprite
  • How to use a particle system
  • How to parse an XML file using tinyxml2

An overview of SpaceCraze

As the last survivor of an elite space combat team, you are faced with the grueling task of making your way back home. In order to do that, however, you must destroy every enemy battleship you encounter and smash your way home.

The controls in this game are straightforward: players must touch to navigate their ship left or right. Both player and enemies will have the ability to shoot bullets to bring destruction upon each other, and bullets for both player and enemies will be fired automatically.

In addition to enemies, there will also be a few obstacles that players will inevitably have to destroy. However, just killing all enemies will be enough to clear a given stage. Also, the player will be blessed with three lives. In this version of the game, we have just five levels, but I urge you design many more on your own. Here is a glimpse of the first level of the game just to get you a bit excited:

An overview of SpaceCraze
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.151.220