Improving collisions

We are going to improve the collisions between our spaceship and the asteroids and projectiles in the game. To simplify things, we will use elastic collisions. An elastic collision is a collision that preserves all of the kinetic energy. In reality, collisions always lose some energy to heat or friction, even ones that are close to elastic collisions, such as billiard balls. However, making our collisions perfectly elastic simplifies the math. In games, simpler math usually means faster algorithms.

For more information on elastic collisions, Wikipedia has an excellent article (https://en.wikipedia.org/wiki/Elastic_collision) that discusses the math we will use to implement our elastic collision function.