We are going to start by implementing circle collision detection because it is the fastest collision detection method available. It also fits well with our projectiles, which will be the most common kind of collider in our game. It will not do a great job on our ships, but later, we can improve that situation by implementing a compound collider that will use multiple circle colliders for each spaceship instead of just one. Because we only have two spaceships, this will give us the best of both worlds in our collision detection: the speed of circle collision detection, along with the accuracy of some of our better collision detection methods.
Let's start by adding a Collider class definition into our game.hpp file and creating a new collider.cpp file where we can define the functions used by our Collider class. Here's what our new...