O'Reilly logo

Windows Phone 8 Game Development by Marcin Jamro

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

Collision detection

In the previous part of this chapter, you prepared the ReachPlanet and CrashWithAsteroid methods. However, you cannot detect situations when the rocket reaches the planet or is crashed. In this part, you will implement a mechanism of detecting collisions between the rocket and other objects in the game world.

Concept

There are many approaches for solving the problem of detecting collisions between objects. One of the common approach is based on an idea of bounding sphere (see the following figure). This approach simplifies the process of finding collisions between elements, because each of them is represented as a sphere. Therefore, you can simply compare distance between centers of two spheres and their radiuses. This approach ...

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