Our original idea was a top-down, free movement RPG. Therefore, we will need some way to detect collisions.
Since we have given the player free 2D movement, we will need to be able to detect collisions from all four cardinal directions at any time.
In order to make the collision system easy to apply to almost any gameplay scenario, we will be using ray casting.
What is Ray Casting?
As has been the standard thus far, we will begin by looking a bit deeper into the methods and systems we will be
using. Simply put, ray casting is exactly what it sounds like. Imagine a game object; make it a square in for simplicity. Now imagine that square
shooting a little line segment out the top (that is, in the +y direction). Much like a creepy crawly bug's little antenna, the line segment will
act as a sensor, giving information regard whether or not any foreign object has coincided with that line segment. Every frame we will shoot one
out a short distance and check if something is there. If there's nothing, we move on. If there is something that we deem a collide-able object,
we do whatever we need to do to keep the square from flying through. That's all there is to it!
The Ray Casting System
We are going to split the collision detection system into a manager and an actual ray caster. The manager will, as
the name suggest, manage information received from the ray caster coupled with inputs that the player has currently given to manipulate the
player object.