new EndGame(x, y)
Simple object that ends the game and declares the player that collides with it the winner
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | x position on canvas |
y |
number | y position on canvas |
- Source:
Methods
endGame(winner)
Ends the game by displaying a dialog notifying who won and a button to click to play again
Parameters:
| Name | Type | Description |
|---|---|---|
winner |
Player | reference to a Player object, the player who reached the treasure chest. |
- Source:
tickActions()
Updates the state of this object, checking to see if a player has collided with it
- Source: