O'Reilly logo

Android Game Programming by Example by John Horton

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

Things that go bump – collision detection

Collision detection is quite a broad subject. Throughout the three projects in this book, we will use a whole range of different ways to detect when things collide.

So, here is a quick look at our options for collision detection, and in which circumstances different methods may be appropriate.

Essentially, we just need to know when certain objects from our game touch other objects. We can then respond to that event by exploding, reducing shields, playing a sound, or whatever is appropriate. We need a broad understanding of our different options so we can make the right decisions in any particular game.

Collision detection options

First of all, here are a few of the different mathematical calculations we can ...

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