Random Shapes button generates random shapes with random sizes. User has the option to
enter a number of shapes. If collisions are detected or inside another shape, then both shapes colour will be red.
Same Space button shows verification that different combinations of shapes are colliding
if within the same space (i.e. one inside the other).
Play Game button challenges the user has to navigate across the screen without clashing into the objects
which are hidden just before the game starts. Another method to show understanding of collisions between the shapes.
A HTML canvas element is used to plot the shapes along an X and Y axis. While the task
didn't require any visuals, it was useful in development to easily see collisions.
The logic is written in Javascript file collision.js.
The program uses the AABB (Axis Aligned Boundary Box) to first
detect if there is a potential conflict in the rectangular boundary and if so the program
will go deeper to find if there is a collision within the boundary.
Most coding logic for detecting collisions/intersections can be found in functions getCollisions, getPlayerCollisions
and checkMultiShapes.