summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-01-17 10:36:37 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-01-17 10:36:37 -0500
commit69b495c392bffe96dab97306a42466edd4b2474e (patch)
tree2adccc01f4027bcb76bbefee03bb6a9622ce3e00 /src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java
parent4c768483aecd687529b9abb48ed42950fabc886f (diff)
downloadfourpuzzle-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.java60
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
6package com.fourisland.fourpuzzle.gamestate;
7
8import com.fourisland.fourpuzzle.Audio;
9import com.fourisland.fourpuzzle.Display;
10import com.fourisland.fourpuzzle.Game;
11import com.fourisland.fourpuzzle.SaveFile;
12import com.fourisland.fourpuzzle.transition.SquareTransition;
13import com.fourisland.fourpuzzle.util.ObjectLoader;
14import java.awt.Graphics2D;
15import java.awt.event.KeyEvent;
16import java.util.logging.Level;
17import java.util.logging.Logger;
18
19/**
20 *
21 * @author hatkirby
22 */
23public 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}