2021-09-13 11:13:43 +00:00
|
|
|
## Exercises
|
|
|
|
|
|
|
|
# Exercise: Game Over
|
|
|
|
|
2021-10-05 08:37:48 +00:00
|
|
|
In this exercise you will add a game over state to the game. After PacMan has lost all of his lives the game will be
|
|
|
|
over. PacMan should not respawn and the ghosts should stop.
|
2021-09-13 11:13:43 +00:00
|
|
|
|
2021-10-05 08:37:48 +00:00
|
|
|
The GameState class has the number of lives and they are already drawn on screen so that information can be used to
|
|
|
|
indicate the game over state itself.
|
2021-09-13 11:13:43 +00:00
|
|
|
|
2021-10-05 08:37:48 +00:00
|
|
|
If the game is over, the text "Game Over" should be drawn over the game board. You do not need to implement a new game,
|
|
|
|
for this exercise restarting the application is enough.
|
2021-09-13 11:13:43 +00:00
|
|
|
|
|
|
|
# Exercise: New Level
|
|
|
|
|
2021-10-05 08:37:48 +00:00
|
|
|
In this exercise you will need to reset the game board but keep score and lives the same. This should happen when PacMan
|
|
|
|
eats the last pellet or super pellet.
|
2021-09-13 11:13:43 +00:00
|
|
|
|
2021-10-05 08:37:48 +00:00
|
|
|
The ghosts and pacman should go back to their original position and all of the pellets should respawn. This can go on
|
|
|
|
forever, but you can look at the next exercise for more information.
|
2021-09-13 11:13:43 +00:00
|
|
|
|
|
|
|
# Exercise: Victory
|
|
|
|
|
2021-10-05 08:37:48 +00:00
|
|
|
As a continuation of the Game Over and New Level exercises. If PacMan beats 3 levels, the game has been beaten and a
|
|
|
|
victory screen should be shown.
|
2021-09-13 11:13:43 +00:00
|
|
|
|
2021-10-05 08:37:48 +00:00
|
|
|
A count of how many levels have been beaten needs to be stored and this should be checked when transitioning between
|
|
|
|
levels.
|
2021-09-13 11:13:43 +00:00
|
|
|
|
|
|
|
This should function similarly to the Game Over state but used to indicate that the player won the game.
|