O'Reilly logo

Cocos2d-x Game Development Essentials by Gareth Jones, Arutosh Gurung, Frahaan Hussain

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 8. Collision Detection

This chapter will cover how Cocos2d-x handles collision detection. This will be used to detect collisions between the space pod and asteroids. There are several methods that can be used but fortunately, over the years, Chukong Technologies has refined Cocos2d-x to incorporate a great physics engine. This is built on top of the existing and popular Chipmunk engine while simplifying its implementation, but the extensively used physics engine Box2d can also be used with Cocos2d-x.

Topics covered in this chapter are as follows:

  • What is collision detection?
  • Setting up collision detection
  • Implementing collision detection

Collision detection

Before implementing collision detection in our game, let's go over what 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