O'Reilly logo

Learning Cocos2d-x Game Development by Siddharth Shekar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Enemies and Controls

In the previous chapter, we saw how to include a character and make it move around. We also saw the start of shooting mechanics. In this chapter, we will improve upon the shooting mechanics and also add enemies that will spawn from the right-hand side of the screen and shoot bullets. The player uses the new control scheme, where they will be boosted up by taps on the left-hand side of the screen and can shoot the enemy by firing rockets as well as avoiding the enemy bullets. We have a lot to cover in this chapter, so let's gets started.

The things you will learn in this chapter are as follows:

  • Creating the enemy class
  • Adding the enemy movement
  • Adding gameplay layer class
  • Creating the projectile class
  • Adding hero controls ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required