Collision detection

To explain it simply, collision is a short duration interaction between two bodies. There are many different types of collisions such as elastic and non-elastic. The study of the intersection of two or more objects overlapping each other is called as collision detection. It is one of the most complex pieces of computational mathematics and is divided into many types, such as:

  • Bounding Box Collision: This is the simplest form of collision techniques wherein we take two rectangles and check for collision if they overlap each other. For this, we need four coordinates of each rectangle, namely, the x and y position and width and height of both rectangles.
  • Circle Collision: This is the second simplest type of collision wherein ...

Get Learning Android Game Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.