As we tried to make the game as finished as possible last week, we did not actually have that much things to do this week. At least nothing major, like a mechanic that had to be implemented. The tasks that i were tasked with this week were the following:
Fixing the player firing mechanic, before i fixed this, firing with the warden felt a bit pathetic. It was so bad and because the way that the attack speed affected everything it made it feel very unresponsive. If you quickly tapped one of the four fire buttons too fast the projectile would not fire. I fixed this by simple lowering the attack speed. This also meant that the powerup that makes the player do more damage and fire faster feels a lot stronger than it previously did. But the gamedesigner and i agreed that it only made the game feel better. And it made the strength powerup feel worthwhile and made the player want to have it.
I also fixed a bug where the player could “plant” a tower even thou the combine seed static method was returning 0, to fix this i added a simple check that checked what value that seed combiner returned, if that value was 0 it would’t plant a tower.
Our game designer also wanted to have a game timer at the bottom of the screen as a way to measure how well the player was doing. I also thought this was a good idea as our game is endless and the only way to measure how well you are doing is by how long you have been surviving.
The biggest thing i implemented this week was our defeat state. The player gets to this state if the player loses and the lifetree is destroyed. A problem that i quickly noticed was that the game state still existed in the memory. That meant that when the player presses the restart button the game state would be the exact same way as it was when the player lost. Because the life tree was already destroyed in the state the player goes to the defeat state again. This was sort of a pain to fix, but i fixed this by adding an overload variable to the defeatstate that takes an StateManager pointer.
The last thing i fixed was an old bug where only one of the three spawnpoints were being activated. The bug was that there was only one variable for three spawnpoints. To fix this I implemented a vector.