Adding Different Enemies
Adding different enemies was a simple task, fortunately, since I already have an enemies group/class. For my new enemies, I wanted ones that were better at close range, and ones better at far range, so I started prototyping a few ideas.
I decided to add red enemies that run quickly and purples ones that can shoot shadow orbs at the player location. The coding of the fast melee enemies was easy to do, since it's almost a carbon copy of the existing enemies, but with more speed and different animations. The coding of the slow shooting enemies was also easy to do, since my sun orbs when clicking the left mouse button have the same interactions and physics.
Adding a Boss
The boss was a really cool addition. My initial idea was to have a large enemy that spawned every five minutes and it would charge at the player in intervals. This ended up being hard to do, since the logic of the charging is difficult to achieve when the location of the player updates frequently. Nevertheless, I got it completed with some fine tuning with the timing and speed to make it not too difficult.
Leaderboard/Score Tracker
To track scores, I had to learn firebase and follow the in class tutortial Hannah provided. From there, with some help from Arissa, I was able to get a working backend quickly. The main problem was that submitting scores and displaying scores occured outside the canvas, so it kind of ruined the flow of the game and appearance.
Though the backend worked, I wanted players to be able to see live updates of the database, so I added the snapshot function so that users could see their or others' scores populate the scoreboard if they made the top 5 in real time.
So, I needed to move everything to p5, which ended up taking a lot of time. I had to read the documentation about how to create, alter, append, and style HTML elements on the canvas. By playing around with the various functions and shower thinking about getting the scoreboard to look how I wanted, I was able to get it working.
Visual Update
I was nearing the end of the timeline and project, so I made a few last minute visual changes. One was an upgrade tracker. This was fairly easy to do, since there is a function in p5 to import images and place them on the canvas. I also decided to change the background images since I realized the images were eating up a lot of resources and didn't fit the theme as well as I envisioned.
Better UX
The last few changes I made were from asking friends to test and what they would want to improve about the gameplay. A few have mentioned that they would want to be able to hold down the mouse instead of having to click all the time, so that was easy to add with the mouseIsPressed built in p5 function. They also mentioned that the timer would run when they clicked off the page, so I added a document event listener to pause the game automatically when the page isn't being viewed.