Basic JS Game - Part 4
In this part, we add message about who wins or loses
- implement the displayMessage function to replace the contents of the 'message' DIV with the text passed in as a parameter
- in the updateGame function, use displayMessage() and function getTimeSurvived() to display a message saying how long the player has survived so far
- use displayMessage to display some text if the game ends because the player and monster collided
- in the updateGame function, put in code so that if the time survived is >= TIME_TO_WIN the game ends and the player sees a 'you won' message
At this stage the project looks like this.