I made so much progress this week! I was trying to figure out how to add different “states” to my maze, such as the scene before the maze is loaded, but with some lecturer feedback I got given a really good idea at how to go about making this, “create a ‘current state’, then change and draw the changes depending on specific interactions” (verbatim).
I then implemented three states. An initial state, that is the first state, a start state, that occurs when the user drags their finger keypoint on the circle, and a third state which occurs when the user collides the circle with the “start bar”
When creating the circle and finger keypoint interactions, I used the inbuilt javascript dist function. However, this only detects the distance between two points. This wouldn’t work when I want to detect a whole shape, like a rect as there are too many coordinate points.
With a lot of motivation, I managed to program the maze in one afternoon! It took a while but thankfully with the collideRectCircle and collideLineCircle functions I imported, managing collisions was easy, but time consuming.
I was so happy during the next day where I got to show of this project! I was happy to see that my project was very intuitive, especially with the instructions on screen, it was easy to use without me even telling people what it was prior to them using it.
Later, I discussed my project with my lecturer and I got some feedback on how to make my code better organized. My code worked but was inefficient, so I changed it. I was drawing each line, and then using a collision function manually for each line. This took a lot of time to write. However, with the feedback I got I turned this into a class, which is then called with methods.
By doing this, all I needed to do was make a new line object and then store this object in an array. I created loops that did all the hard work for me, so this array was looped over, and each line object in this array was then drawn and was checked for collisions.

I also did some more essay work this week, including organising my references (harvard reference) and trying to cut down on my wordcount.