diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java')
-rwxr-xr-x | src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java b/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java index ed379cc..7466788 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java +++ b/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java | |||
@@ -24,11 +24,13 @@ public class GameOverGameState implements GameState { | |||
24 | 24 | ||
25 | public void initalize() | 25 | public void initalize() |
26 | { | 26 | { |
27 | // Play the Database-specifed Game Over music | ||
27 | Audio.playMusic(Database.getMusic(Music.GameOver)); | 28 | Audio.playMusic(Database.getMusic(Music.GameOver)); |
28 | } | 29 | } |
29 | 30 | ||
30 | public void deinitalize() | 31 | public void deinitalize() |
31 | { | 32 | { |
33 | // Stop the music | ||
32 | Audio.stopMusic(); | 34 | Audio.stopMusic(); |
33 | } | 35 | } |
34 | 36 | ||
@@ -36,6 +38,13 @@ public class GameOverGameState implements GameState { | |||
36 | { | 38 | { |
37 | if (key.isActionDown()) | 39 | if (key.isActionDown()) |
38 | { | 40 | { |
41 | /* When the user presses the action key to exit the game over | ||
42 | * screen, clear the save data and transition back to the title | ||
43 | * screen. | ||
44 | * | ||
45 | * NOTE: Clearing the save data may not actually be necessary here | ||
46 | * because TitleScreenGameState clears the save data before starting | ||
47 | * a new file */ | ||
39 | Game.setSaveFile(new SaveFile()); | 48 | Game.setSaveFile(new SaveFile()); |
40 | 49 | ||
41 | try { | 50 | try { |
@@ -53,6 +62,7 @@ public class GameOverGameState implements GameState { | |||
53 | 62 | ||
54 | public void render(Graphics2D g) | 63 | public void render(Graphics2D g) |
55 | { | 64 | { |
65 | // Display the Game Over picture | ||
56 | g.drawImage(ObjectLoader.getImage("Picture", "GameOver"), 0, 0, null); | 66 | g.drawImage(ObjectLoader.getImage("Picture", "GameOver"), 0, 0, null); |
57 | } | 67 | } |
58 | 68 | ||