summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-02-16 13:03:07 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-02-16 13:03:07 -0500
commit0540ce566ddce97a60c3279c51d5c5ddf1645321 (patch)
treeded689d601e61d054c5e7c8d32802aafd0416665 /src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java
parent1db6402b9171fc13b377b01d49531659a4e1fc76 (diff)
downloadfourpuzzle-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/mapview/event/SpecialEvent.java')
-rwxr-xr-xsrc/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java index 9336616..ebb0e27 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java
@@ -155,12 +155,9 @@ public class SpecialEvent {
155 */ 155 */
156 public void GameOver() throws InterruptedException 156 public void GameOver() throws InterruptedException
157 { 157 {
158 Display.transition(Database.getTransition(Transitions.MapToGameOver));
159
160 Audio.stopMusic(); 158 Audio.stopMusic();
161 Game.setGameState(new GameOverGameState()); 159
162 160 Display.transition(Database.getTransition(Transitions.MapToGameOver), new GameOverGameState(), Database.getTransition(Transitions.GameOverEnter), false);
163 Display.transition(Database.getTransition(Transitions.GameOverEnter));
164 } 161 }
165 162
166 /** 163 /**
@@ -170,12 +167,9 @@ public class SpecialEvent {
170 */ 167 */
171 public void TitleScreen() throws InterruptedException 168 public void TitleScreen() throws InterruptedException
172 { 169 {
173 Display.transition(Database.getTransition(Transitions.MapToTitle));
174
175 Audio.stopMusic(); 170 Audio.stopMusic();
176 Game.setGameState(new TitleScreenGameState());
177 171
178 Display.transition(Database.getTransition(Transitions.TitleEnter)); 172 Display.transition(Database.getTransition(Transitions.MapToTitle), new TitleScreenGameState(), Database.getTransition(Transitions.TitleEnter), false);
179 } 173 }
180 174
181 private boolean startedTransition = false; 175 private boolean startedTransition = false;
@@ -217,14 +211,9 @@ public class SpecialEvent {
217 { 211 {
218 if (!startedTransition) 212 if (!startedTransition)
219 { 213 {
220 Display.transition(Database.getTransition(Transitions.MapExit)); 214 Display.transition(Database.getTransition(Transitions.MapExit), new MapViewGameState(map, x, y), Database.getTransition(Transitions.MapEnter), false);
221 } 215 } else {
222 216 Game.setGameState(new MapViewGameState(map, x, y));
223 Game.setGameState(new MapViewGameState(map, x, y));
224
225 if (!startedTransition)
226 {
227 Display.transition(Database.getTransition(Transitions.MapEnter));
228 } 217 }
229 } 218 }
230 219