Week 7: Developer journal


This week was making final changes to the game, sending of feedback and final work for submission.

Not much has changed here I added the controls UI to explain controls at the bottom of the screen and added some comments to the code.
I also moved all of the logic of when the game is over to within the call for it instead of having it happen before the call as it meant less repetition of code when I wanted to call to restart after winning through the reset button.
This was done in the enemy update function where this adds the r key as a control.
This is the code for the winning screen after beating the final wave which just has some UI congratulating the player and giving the option to restart.
This is a condition constantly called after victory is set to true when if r is pressed (restart key) then game over is set to true which calls to the restart of the game.
I also made changes to the invulnerability after getting damaged system to a time based system over the frame based that it was before. This works through taking the length of time of the invulnerability timer dividing it by the current time minus the time since last frame. I also added more comments to this section of code.
I also made some changes to the healing system which was increasing healing from 2 to 5 and adding a condition to if the player has 100 health (full health) then it won’t pickup the consumable.

Final version of the game: https://georgebaker.nuacomputerscience.co.uk/2D%20Game/2DGame.html