O'Reilly logo

Android Studio Game Development: Concepts and Design by J. F. DiMarzio

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    10

Collision Detection

Collision detection is a key component to almost any game and almost every game type. In a game without collision detection, items, obstacles, characters, and weapons would move about the screen and float past each other without any consequence.

Your game code needs to be able to determine whether objects that are on the screen touch or cross paths with each other. It is only after you determine that two or more objects are touching that you can then perform actions on them such as applying damage, stopping motion, powering up a character, or destroying an object.

Using Basic Collision Detection

Basic collision detection is useful if you are creating a game in which a character is faced with static obstacles ...

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