diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-01-17 10:36:37 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-01-17 10:36:37 -0500 |
commit | 69b495c392bffe96dab97306a42466edd4b2474e (patch) | |
tree | 2adccc01f4027bcb76bbefee03bb6a9622ce3e00 /src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java | |
parent | 4c768483aecd687529b9abb48ed42950fabc886f (diff) | |
download | fourpuzzle-69b495c392bffe96dab97306a42466edd4b2474e.tar.gz fourpuzzle-69b495c392bffe96dab97306a42466edd4b2474e.tar.bz2 fourpuzzle-69b495c392bffe96dab97306a42466edd4b2474e.zip |
Imported sources
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java')
-rw-r--r-- | src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java b/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java new file mode 100644 index 0000000..ebff457 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * To change this template, choose Tools | Templates | ||
3 | * and open the template in the editor. | ||
4 | */ | ||
5 | |||
6 | package com.fourisland.fourpuzzle.gamestate; | ||
7 | |||
8 | import com.fourisland.fourpuzzle.Audio; | ||
9 | import com.fourisland.fourpuzzle.Display; | ||
10 | import com.fourisland.fourpuzzle.Game; | ||
11 | import com.fourisland.fourpuzzle.SaveFile; | ||
12 | import com.fourisland.fourpuzzle.transition.SquareTransition; | ||
13 | import com.fourisland.fourpuzzle.util.ObjectLoader; | ||
14 | import java.awt.Graphics2D; | ||
15 | import java.awt.event.KeyEvent; | ||
16 | import java.util.logging.Level; | ||
17 | import java.util.logging.Logger; | ||
18 | |||
19 | /** | ||
20 | * | ||
21 | * @author hatkirby | ||
22 | */ | ||
23 | public class GameOverGameState implements GameState { | ||
24 | |||
25 | public void initalize() throws Exception | ||
26 | { | ||
27 | Audio.playMusic("GameOver"); | ||
28 | } | ||
29 | |||
30 | public void deinitalize() throws Exception | ||
31 | { | ||
32 | Audio.stopMusic(); | ||
33 | } | ||
34 | |||
35 | public void processInput() throws Exception { | ||
36 | if ((Game.getKey().getKeyCode() == KeyEvent.VK_ENTER) || (Game.getKey().getKeyCode() == KeyEvent.VK_SPACE)) | ||
37 | { | ||
38 | Game.setSaveFile(new SaveFile()); | ||
39 | //Display.transition(SquareTransition.class, this, new TitleScreenGameState()); | ||
40 | Display.transition(new SquareTransition(true), new Runnable() { | ||
41 | public void run() { | ||
42 | try { | ||
43 | Game.setGameState(new TitleScreenGameState()); | ||
44 | } catch (Exception ex) { | ||
45 | Logger.getLogger(GameOverGameState.class.getName()).log(Level.SEVERE, null, ex); | ||
46 | } | ||
47 | } | ||
48 | }); | ||
49 | } | ||
50 | } | ||
51 | |||
52 | public void doGameCycle() throws Exception { | ||
53 | // Do nothing | ||
54 | } | ||
55 | |||
56 | public void render(Graphics2D g) throws Exception { | ||
57 | g.drawImage(ObjectLoader.getImage("Picture", "GameOver"), 0, 0, null); | ||
58 | } | ||
59 | |||
60 | } | ||