This week I began giving my player the ability to shoot. It went through several iterations , for example at the start it would shoot left and right on the same Z axis but I felt like it could have been improved so I decided to make it so the bullet shoots towards the player’s cursor . This was done to add an extra bit of excitement as the player is more involved with where the bullet lands. It also took a while to play around with the bullet’s physics to give it the feel I was going for. After several days of work I managed to get it to a point I was happy with.
Once the shooting was created , I began work on creating an enemy class and a function for when a bullet and enemy overlap. In this function I made it so a string was sent via console.log to ensure that the function was being called and if so, only once. Fortunately it worked fairly well the first time. I also made it so zombies spawn in every 3~ seconds and they would alternate between 2 sides of the map. This was done so the player couldn’t just “spawn camp” the zombies as they spawn in, making it harder for the player as a whole.
Despite me not doing much this week, I would still call it a success as I have managed to almost nail 2 key mechanics for my project which I was expecting to take the most amount of time. My goals for next week are to give enemies health and have them be destroyed upon reaching 0 (or lower) health and having the correct global variables such as player score and total kills be increased.