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 4. Collision Detection and Scoring

Continuing from where we left off in the previous chapter, we will look at collision detection and keeping track of the score in the game in this chapter. Apart from just coding collision detection, we will also look at the different types of collision mechanics in games, be it circular, box, per-pixel, or Box2D collision. Bear in mind that what we will be going through are just few ways of collision detection. A whole book can be dedicated to the topic. What is important for any developer is that they make sure the collision is detected without taxing the CPU too much.

In this chapter, we will cover the following topics:

  • Theory of collision detection
  • Circular collision detection
  • Box collision detection

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