The current Axis-Aligned Bounding Box implementation doesn't properly resolve collisions.
A more robust implementation should offer:
normal vector of the collision edge (used for negating/reflecting velocity perpendicular to the surface)
properly position colliding objects (objects that can move should be just barely touching)
In addition, if we plan on having fast-moving projectiles later on, I recommend looking into continuous collision detection via swept AABBs, but let's focus on getting regular collision resolutions working first.
The current Axis-Aligned Bounding Box implementation doesn't properly resolve collisions. A more robust implementation should offer:
In addition, if we plan on having fast-moving projectiles later on, I recommend looking into continuous collision detection via swept AABBs, but let's focus on getting regular collision resolutions working first.
Recommended reading: https://noonat.github.io/intersect/