diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-02-16 13:03:07 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-02-16 13:03:07 -0500 |
commit | 0540ce566ddce97a60c3279c51d5c5ddf1645321 (patch) | |
tree | ded689d601e61d054c5e7c8d32802aafd0416665 /src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java | |
parent | 1db6402b9171fc13b377b01d49531659a4e1fc76 (diff) | |
download | fourpuzzle-0540ce566ddce97a60c3279c51d5c5ddf1645321.tar.gz fourpuzzle-0540ce566ddce97a60c3279c51d5c5ddf1645321.tar.bz2 fourpuzzle-0540ce566ddce97a60c3279c51d5c5ddf1645321.zip |
Engine: Abstracted game state transitions
Previously, every game state transition was manually executed with a thread, some exception handling and Display. Now, Display has a method that takes care of it without leaving all of the bulk in random classes.
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java')
-rwxr-xr-x | src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java b/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java index e87f80a..670d900 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java +++ b/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java | |||
@@ -38,23 +38,7 @@ public class GameOverGameState implements GameState { | |||
38 | { | 38 | { |
39 | Game.setSaveFile(new SaveFile()); | 39 | Game.setSaveFile(new SaveFile()); |
40 | 40 | ||
41 | new Thread(new Runnable() { | 41 | Display.transition(Database.getTransition(Transitions.GameOverToTitle), new TitleScreenGameState(), Database.getTransition(Transitions.TitleEnter), true); |
42 | public void run() { | ||
43 | try { | ||
44 | Display.transition(Database.getTransition(Transitions.GameOverToTitle)); | ||
45 | } catch (InterruptedException ex) { | ||
46 | Thread.currentThread().interrupt(); | ||
47 | } | ||
48 | |||
49 | Game.setGameState(new TitleScreenGameState()); | ||
50 | |||
51 | try { | ||
52 | Display.transition(Database.getTransition(Transitions.TitleEnter)); | ||
53 | } catch (InterruptedException ex) { | ||
54 | Thread.currentThread().interrupt(); | ||
55 | } | ||
56 | } | ||
57 | }).start(); | ||
58 | } | 42 | } |
59 | } | 43 | } |
60 | 44 | ||