[ LiB ] |
We are nearing the end of Part Two. This chapter explains the art of collision detec-tion. Collision detection allows your program to check if an object on your screen has been hit by another object, and performs actions based on the check. For example, if you made a space shooter, and you wanted to check if a missile hit an enemy ship, you would use collision detection. If the ship had been hit, you might decrease its hit points, or destroy it all together.
There are a few ways to check for collision detection, and we are going to go through them now. We can use bounding boxes, both rectangular and circular, and pixel-perfect collisions. Let's start off checking collision with a single pixel.
[ LiB ] |