Bag Of Cows

Basic JS Game - Part 4

In this part, we add message about who wins or loses

  1. implement the displayMessage function to replace the contents of the 'message' DIV with the text passed in as a parameter
  2. in the updateGame function, use displayMessage() and function getTimeSurvived() to display a message saying how long the player has survived so far
  3. use displayMessage to display some text if the game ends because the player and monster collided
  4. 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.

Part 5