From b384ef4a400bd8d830822a73ac99627d9a5e5fc7 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Mon, 9 Feb 2009 16:05:58 -0500 Subject: Re-implemented Database See #8 --- src/com/fourisland/fourpuzzle/Database.java | 101 ----------------- src/com/fourisland/fourpuzzle/GameCharacter.java | 61 ----------- src/com/fourisland/fourpuzzle/GameCharacters.java | 71 ------------ .../fourisland/fourpuzzle/PuzzleApplication.java | 6 +- src/com/fourisland/fourpuzzle/SaveFile.java | 2 + .../fourisland/fourpuzzle/database/Database.java | 121 +++++++++++++++++++++ .../fourpuzzle/database/GameCharacter.java | 61 +++++++++++ .../fourpuzzle/database/GameCharacters.java | 72 ++++++++++++ src/com/fourisland/fourpuzzle/database/Music.java | 31 ++++++ src/com/fourisland/fourpuzzle/database/Sound.java | 31 ++++++ .../fourpuzzle/database/Transitions.java | 68 ++++++++++++ .../fourisland/fourpuzzle/database/Vocabulary.java | 33 ++++++ .../fourpuzzle/gamestate/GameOverGameState.java | 5 +- .../fourpuzzle/gamestate/TitleScreenGameState.java | 16 ++- .../gamestate/mapview/event/HeroEvent.java | 2 +- .../gamestate/mapview/event/SpecialEvent.java | 6 +- .../fourisland/fourpuzzle/window/ChoiceWindow.java | 7 +- 17 files changed, 446 insertions(+), 248 deletions(-) delete mode 100755 src/com/fourisland/fourpuzzle/Database.java delete mode 100755 src/com/fourisland/fourpuzzle/GameCharacter.java delete mode 100755 src/com/fourisland/fourpuzzle/GameCharacters.java create mode 100755 src/com/fourisland/fourpuzzle/database/Database.java create mode 100755 src/com/fourisland/fourpuzzle/database/GameCharacter.java create mode 100755 src/com/fourisland/fourpuzzle/database/GameCharacters.java create mode 100644 src/com/fourisland/fourpuzzle/database/Music.java create mode 100644 src/com/fourisland/fourpuzzle/database/Sound.java create mode 100644 src/com/fourisland/fourpuzzle/database/Transitions.java create mode 100644 src/com/fourisland/fourpuzzle/database/Vocabulary.java (limited to 'src') diff --git a/src/com/fourisland/fourpuzzle/Database.java b/src/com/fourisland/fourpuzzle/Database.java deleted file mode 100755 index 30bc8a3..0000000 --- a/src/com/fourisland/fourpuzzle/Database.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package com.fourisland.fourpuzzle; - -import com.fourisland.fourpuzzle.transition.SquareTransition; -import com.fourisland.fourpuzzle.transition.Transition; -import com.fourisland.fourpuzzle.transition.TransitionDirection; -import java.util.HashMap; - -/** - * - * @author hatkirby - */ -public class Database { - - private static HashMap vocabulary = new HashMap(); - private static GameCharacters heros = GameCharacters.getDefaultParty(); - private static HashMap music = new HashMap(); - private static HashMap transitions = new HashMap(); - - static { - loadDefaultVocabulary(); - loadDefaultMusic(); - loadDefaultTransitions(); - } - - /* Vocabulary */ - - private static void loadDefaultVocabulary() - { - /* Global */ - vocabulary.put("Title", "Untitled Game"); - - /* TitleScreen */ - vocabulary.put("NewGame", "New Game"); - vocabulary.put("LoadGame", "Load Game"); - vocabulary.put("EndGame", "End"); - } - - public static String getVocab(String key) - { - return vocabulary.get(key); - } - - public static void setVocab(String key, String value) - { - vocabulary.put(key, value); - } - - /* Heros */ - - public static void addHero(GameCharacter hero) - { - heros.add(hero); - } - - public static GameCharacters createParty() - { - return GameCharacters.createParty(); - } - - /* Music */ - - public static void loadDefaultMusic() - { - music.put("Title", "Opening1"); - music.put("GameOver", "GameOver"); - } - - public static String getMusic(String key) - { - return music.get(key); - } - - public static void setMusic(String key, String value) - { - music.put(key, value); - } - - /* Transitions */ - - public static void loadDefaultTransitions() - { - transitions.put("MapExit", new SquareTransition(TransitionDirection.Out)); - transitions.put("MapEnter", new SquareTransition(TransitionDirection.In)); - } - - public static Transition getTransition(String key) - { - return transitions.get(key).copy(); - } - - public static void setTransition(String key, Transition value) - { - transitions.put(key, value); - } - -} diff --git a/src/com/fourisland/fourpuzzle/GameCharacter.java b/src/com/fourisland/fourpuzzle/GameCharacter.java deleted file mode 100755 index 8557fef..0000000 --- a/src/com/fourisland/fourpuzzle/GameCharacter.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package com.fourisland.fourpuzzle; - -import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.BlankEventGraphic; -import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.EventGraphic; - -/** - * - * @author hatkirby - */ -public class GameCharacter { - - public GameCharacter(String name) - { - this.name = name; - } - - private String name; - public String getName() - { - return name; - } - public void setName(String name) - { - this.name = name; - } - - private int level = 1; - public int getLevel() { - return level; - } - public void setLevel(int level) - { - this.level = level; - } - - private boolean inParty = false; - public boolean isInParty() - { - return inParty; - } - public void setInParty(boolean inParty) - { - this.inParty = inParty; - } - - private EventGraphic graphic = new BlankEventGraphic(); - public EventGraphic getGraphic() - { - return graphic; - } - public void setGraphic(EventGraphic graphic) - { - this.graphic = graphic; - } - -} diff --git a/src/com/fourisland/fourpuzzle/GameCharacters.java b/src/com/fourisland/fourpuzzle/GameCharacters.java deleted file mode 100755 index 211b66d..0000000 --- a/src/com/fourisland/fourpuzzle/GameCharacters.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package com.fourisland.fourpuzzle; - -import com.fourisland.fourpuzzle.gamestate.GameOverGameState; -import java.util.ArrayList; - -/** - * - * @author hatkirby - */ -public class GameCharacters extends ArrayList -{ - private GameCharacters() {} - - private static GameCharacters INSTANCE = new GameCharacters(); - static GameCharacters getDefaultParty() - { - return INSTANCE; - } - - static GameCharacters createParty() - { - GameCharacters temp = new GameCharacters(); - temp.addAll(INSTANCE); - - return temp; - } - - public GameCharacter getLeader() - { - for (GameCharacter chara : this) - { - if (chara.isInParty()) - { - return chara; - } - } - - Game.setGameState(new GameOverGameState()); - return null; - } - - public boolean exists(String heroName) { - for (GameCharacter chara : this) - { - if (chara.getName().equals(heroName)) - { - return true; - } - } - - return false; - } - - public GameCharacter get(String heroName) throws NullPointerException { - for (GameCharacter chara : this) - { - if (chara.getName().equals(heroName)) - { - return chara; - } - } - - throw new NullPointerException("Could not find character \"" + heroName + "\""); - } - -} diff --git a/src/com/fourisland/fourpuzzle/PuzzleApplication.java b/src/com/fourisland/fourpuzzle/PuzzleApplication.java index edf6ac8..25aee9f 100755 --- a/src/com/fourisland/fourpuzzle/PuzzleApplication.java +++ b/src/com/fourisland/fourpuzzle/PuzzleApplication.java @@ -4,6 +4,8 @@ */ package com.fourisland.fourpuzzle; +import com.fourisland.fourpuzzle.database.Database; +import com.fourisland.fourpuzzle.database.Vocabulary; import com.fourisland.fourpuzzle.gamestate.TitleScreenGameState; import com.fourisland.fourpuzzle.gamestate.mapview.ChipSet; import com.fourisland.fourpuzzle.util.Interval; @@ -42,7 +44,7 @@ public class PuzzleApplication extends Application { INSTANCE = this; gameFrame = new JDialog(new JFrame(), false); - gameFrame.setTitle(Database.getVocab("title")); + gameFrame.setTitle(Database.getVocab(Vocabulary.Title)); gameFrame.setSize(Game.WIDTH * 2, Game.HEIGHT * 2); gameFrame.setResizable(false); gameFrame.addWindowListener(new WindowAdapter() { @@ -153,7 +155,7 @@ public class PuzzleApplication extends Application { JFrame errorBox = new JFrame(ex.getClass().getSimpleName()); JLabel text = new JLabel(); - text.setText("
I'm sorry, but " + Database.getVocab("Title") + + text.setText("
I'm sorry, but " + Database.getVocab(Vocabulary.Title) + " has run into an error and been forced to quit.
Your save file has not been kept. The error was:

" + ex.getMessage() + "
"); if (ex instanceof Error) diff --git a/src/com/fourisland/fourpuzzle/SaveFile.java b/src/com/fourisland/fourpuzzle/SaveFile.java index d079f0f..a98e8bf 100755 --- a/src/com/fourisland/fourpuzzle/SaveFile.java +++ b/src/com/fourisland/fourpuzzle/SaveFile.java @@ -4,6 +4,8 @@ */ package com.fourisland.fourpuzzle; +import com.fourisland.fourpuzzle.database.GameCharacters; +import com.fourisland.fourpuzzle.database.Database; import com.fourisland.fourpuzzle.gamestate.mapview.event.HeroEvent; import java.io.IOException; import java.io.InputStream; diff --git a/src/com/fourisland/fourpuzzle/database/Database.java b/src/com/fourisland/fourpuzzle/database/Database.java new file mode 100755 index 0000000..6d61f37 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/database/Database.java @@ -0,0 +1,121 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.fourisland.fourpuzzle.database; + +import com.fourisland.fourpuzzle.transition.Transition; + +/** + * + * @author hatkirby + */ +public class Database { + + public static String getVocab(Vocabulary key) + { + return key.getValue(); + } + + /** + * Sets a Vocabulary definition + * + * FourPuzzle uses pre-defined Vocabulary strings in many places such as + * for the Title of the game, menu options and more. There are default + * values for all of these definitions, but you can change them if you wish, + * using this function. + * + * @param key The Vocabulary to set + * @param value The value to set the Vocabulary to + */ + public static void setVocab(Vocabulary key, String value) + { + key.setValue(value); + } + + /** + * Adds a Hero to the party + * + * When making a game, you need characters, at least one playable character. + * You have to create your characters and use this function to add them to + * the central list of playable characters, or your game will not work. + * There are no default characters, so this is a must-do. + * + * @param hero The Hero to add + */ + public static void addHero(GameCharacter hero) + { + GameCharacters.getDefaultParty().add(hero); + } + + public static GameCharacters createParty() + { + return GameCharacters.createParty(); + } + + public static String getMusic(Music key) + { + return key.getValue(); + } + + /** + * Change a default Music value + * + * In certain places of your game, such as the Title Screen and Game Over + * screen, background music plays. You can tell FourPuzzle what Music to + * play during these instances with this function. There are default values + * for all instances, though. + * + * @param key The Music instance you wish to change + * @param value The name of the Music file you wish to change it to + */ + public static void setMusic(Music key, String value) + { + key.setValue(value); + } + + public static Transition getTransition(Transitions key) + { + return key.getValue().copy(); + } + + /** + * Set a default Transition + * + * In certain places, a Transition may be displayed that you did not + * directly incur. These are default transitions, but they can be changed + * if you wish by using this function. + * + * Warning, all Transition instances have a required type of transition, + * whether it be In or Out. If you provide the wrong type of Transition for + * a certain instance, your game will not run. + * + * @param key The transition to change + * @param value The transition to change it to + */ + public static void setTransition(Transitions key, Transition value) + { + key.setValue(value); + } + + public static String getSound(Sound key) + { + return key.getValue(); + } + + /** + * Change a default sound effect + * + * Sound Effects are used in many places of the game. The default sound + * effects for certain situations can be changed using this function. + * + * @param key The Sound instance to change + * @param value The name of the Sound file to change it to + */ + public static void setSound(Sound key, String value) + { + key.setValue(value); + } + +} diff --git a/src/com/fourisland/fourpuzzle/database/GameCharacter.java b/src/com/fourisland/fourpuzzle/database/GameCharacter.java new file mode 100755 index 0000000..3930b96 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/database/GameCharacter.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.fourisland.fourpuzzle.database; + +import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.BlankEventGraphic; +import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.EventGraphic; + +/** + * + * @author hatkirby + */ +public class GameCharacter { + + public GameCharacter(String name) + { + this.name = name; + } + + private String name; + public String getName() + { + return name; + } + public void setName(String name) + { + this.name = name; + } + + private int level = 1; + public int getLevel() { + return level; + } + public void setLevel(int level) + { + this.level = level; + } + + private boolean inParty = false; + public boolean isInParty() + { + return inParty; + } + public void setInParty(boolean inParty) + { + this.inParty = inParty; + } + + private EventGraphic graphic = new BlankEventGraphic(); + public EventGraphic getGraphic() + { + return graphic; + } + public void setGraphic(EventGraphic graphic) + { + this.graphic = graphic; + } + +} diff --git a/src/com/fourisland/fourpuzzle/database/GameCharacters.java b/src/com/fourisland/fourpuzzle/database/GameCharacters.java new file mode 100755 index 0000000..bcd533a --- /dev/null +++ b/src/com/fourisland/fourpuzzle/database/GameCharacters.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.fourisland.fourpuzzle.database; + +import com.fourisland.fourpuzzle.*; +import com.fourisland.fourpuzzle.gamestate.GameOverGameState; +import java.util.ArrayList; + +/** + * + * @author hatkirby + */ +public class GameCharacters extends ArrayList +{ + private GameCharacters() {} + + private static GameCharacters INSTANCE = new GameCharacters(); + static GameCharacters getDefaultParty() + { + return INSTANCE; + } + + static GameCharacters createParty() + { + GameCharacters temp = new GameCharacters(); + temp.addAll(INSTANCE); + + return temp; + } + + public GameCharacter getLeader() + { + for (GameCharacter chara : this) + { + if (chara.isInParty()) + { + return chara; + } + } + + Game.setGameState(new GameOverGameState()); + return null; + } + + public boolean exists(String heroName) { + for (GameCharacter chara : this) + { + if (chara.getName().equals(heroName)) + { + return true; + } + } + + return false; + } + + public GameCharacter get(String heroName) throws NullPointerException { + for (GameCharacter chara : this) + { + if (chara.getName().equals(heroName)) + { + return chara; + } + } + + throw new NullPointerException("Could not find character \"" + heroName + "\""); + } + +} diff --git a/src/com/fourisland/fourpuzzle/database/Music.java b/src/com/fourisland/fourpuzzle/database/Music.java new file mode 100644 index 0000000..4e00ccb --- /dev/null +++ b/src/com/fourisland/fourpuzzle/database/Music.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.fourisland.fourpuzzle.database; + +/** + * + * @author hatkirby + */ +public enum Music { + Title("Opening1"), + GameOver("GameOver"); + + private String value; + private Music(String value) + { + this.value = value; + } + + String getValue() + { + return value; + } + + void setValue(String value) + { + this.value = value; + } +} diff --git a/src/com/fourisland/fourpuzzle/database/Sound.java b/src/com/fourisland/fourpuzzle/database/Sound.java new file mode 100644 index 0000000..40fda37 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/database/Sound.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.fourisland.fourpuzzle.database; + +/** + * + * @author hatkirby + */ +public enum Sound { + MoveCursor("Cursor1"), + Selection("Decision2"); + + private String value; + private Sound(String value) + { + this.value = value; + } + + String getValue() + { + return value; + } + + void setValue(String value) + { + this.value = value; + } +} diff --git a/src/com/fourisland/fourpuzzle/database/Transitions.java b/src/com/fourisland/fourpuzzle/database/Transitions.java new file mode 100644 index 0000000..e45ad6d --- /dev/null +++ b/src/com/fourisland/fourpuzzle/database/Transitions.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.fourisland.fourpuzzle.database; + +import com.fourisland.fourpuzzle.transition.InTransition; +import com.fourisland.fourpuzzle.transition.MultidirectionalTransition; +import com.fourisland.fourpuzzle.transition.OutTransition; +import com.fourisland.fourpuzzle.transition.SquareTransition; +import com.fourisland.fourpuzzle.transition.Transition; +import com.fourisland.fourpuzzle.transition.TransitionDirection; +import com.fourisland.fourpuzzle.transition.TransitionUnsupportedException; + +/** + * + * @author hatkirby + */ +public enum Transitions { + MapExit(TransitionDirection.Out, new SquareTransition(TransitionDirection.Out)), + MapEnter(TransitionDirection.In, new SquareTransition(TransitionDirection.In)); + + private final TransitionDirection dir; + private Transition trans; + private Transitions(TransitionDirection dir, Transition trans) + { + this.dir = dir; + + if (isTransitionSupported(dir, trans)) + { + this.trans = trans; + } else { + throw new TransitionUnsupportedException(trans.getClass().getName(), dir); + } + } + + Transition getValue() + { + return trans; + } + + void setValue(Transition trans) + { + if (isTransitionSupported(dir, trans)) + { + this.trans = trans; + } else { + throw new TransitionUnsupportedException(trans.getClass().getName(), dir); + } + } + + private boolean isTransitionSupported(TransitionDirection dir, Transition trans) + { + if (trans instanceof MultidirectionalTransition) + { + return (((MultidirectionalTransition) trans).getDirection() == dir); + } else if (trans instanceof OutTransition) + { + return (dir == TransitionDirection.Out); + } else if (trans instanceof InTransition) + { + return (dir == TransitionDirection.In); + } + + return false; + } +} diff --git a/src/com/fourisland/fourpuzzle/database/Vocabulary.java b/src/com/fourisland/fourpuzzle/database/Vocabulary.java new file mode 100644 index 0000000..e79f3c0 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/database/Vocabulary.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.fourisland.fourpuzzle.database; + +/** + * + * @author hatkirby + */ +public enum Vocabulary { + Title("Untitled Game"), + NewGame("New Game"), + LoadGame("Load Game"), + EndGame("End Game"); + + private String value; + private Vocabulary(String value) + { + this.value = value; + } + + String getValue() + { + return value; + } + + void setValue(String value) + { + this.value = value; + } +} diff --git a/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java b/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java index 53cae37..459f730 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java +++ b/src/com/fourisland/fourpuzzle/gamestate/GameOverGameState.java @@ -6,10 +6,11 @@ package com.fourisland.fourpuzzle.gamestate; import com.fourisland.fourpuzzle.Audio; -import com.fourisland.fourpuzzle.Database; +import com.fourisland.fourpuzzle.database.Database; import com.fourisland.fourpuzzle.Display; import com.fourisland.fourpuzzle.Game; import com.fourisland.fourpuzzle.SaveFile; +import com.fourisland.fourpuzzle.database.Music; import com.fourisland.fourpuzzle.transition.SquareTransition; import com.fourisland.fourpuzzle.transition.TransitionDirection; import com.fourisland.fourpuzzle.util.ObjectLoader; @@ -24,7 +25,7 @@ public class GameOverGameState implements GameState { public void initalize() { - Audio.playMusic(Database.getMusic("GameOver")); + Audio.playMusic(Database.getMusic(Music.GameOver)); } public void deinitalize() diff --git a/src/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java b/src/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java index cf8b908..ad1ffe1 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java +++ b/src/com/fourisland/fourpuzzle/gamestate/TitleScreenGameState.java @@ -5,7 +5,11 @@ package com.fourisland.fourpuzzle.gamestate; +import com.fourisland.fourpuzzle.database.Database; import com.fourisland.fourpuzzle.*; +import com.fourisland.fourpuzzle.database.Music; +import com.fourisland.fourpuzzle.database.Sound; +import com.fourisland.fourpuzzle.database.Vocabulary; import com.fourisland.fourpuzzle.gamestate.mapview.MapViewGameState; import com.fourisland.fourpuzzle.transition.SquareTransition; import com.fourisland.fourpuzzle.transition.TransitionDirection; @@ -27,9 +31,9 @@ public class TitleScreenGameState implements GameState { public void initalize() { - Audio.playMusic(Database.getMusic("Title")); + Audio.playMusic(Database.getMusic(Music.Title)); - choices = new ChoiceWindow(Arrays.asList(Database.getVocab("NewGame"), Database.getVocab("LoadGame"), Database.getVocab("EndGame")), true); + choices = new ChoiceWindow(Arrays.asList(Database.getVocab(Vocabulary.NewGame), Database.getVocab(Vocabulary.LoadGame), Database.getVocab(Vocabulary.EndGame)), true); wx = (Game.WIDTH/2)-(choices.getWidth()/2); wy = (Game.HEIGHT/4*3)-(choices.getHeight()/2); } @@ -46,9 +50,9 @@ public class TitleScreenGameState implements GameState { { if (Game.getKey().getKeyCode() == KeyEvent.VK_ENTER) { - Audio.playSound("Decision2"); + Audio.playSound(Database.getSound(Sound.Selection)); - if (choices.getSelected().equals(Database.getVocab("NewGame"))) + if (choices.getSelected().equals(Database.getVocab(Vocabulary.NewGame))) { Game.setSaveFile(new SaveFile()); @@ -69,10 +73,10 @@ public class TitleScreenGameState implements GameState { } } }).start(); - } else if (choices.getSelected().equals(Database.getVocab("LoadGame"))) + } else if (choices.getSelected().equals(Database.getVocab(Vocabulary.LoadGame))) { // Do nothing, yet - } else if (choices.getSelected().equals(Database.getVocab("EndGame"))) + } else if (choices.getSelected().equals(Database.getVocab(Vocabulary.EndGame))) { new Thread(new Runnable() { public void run() { diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java index f39c451..fac21c6 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java @@ -10,7 +10,7 @@ import java.awt.Graphics; import java.awt.Point; import com.fourisland.fourpuzzle.Direction; import com.fourisland.fourpuzzle.Game; -import com.fourisland.fourpuzzle.GameCharacter; +import com.fourisland.fourpuzzle.database.GameCharacter; import com.fourisland.fourpuzzle.gamestate.mapview.Map; import com.fourisland.fourpuzzle.gamestate.mapview.MapViewGameState; import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.BlankEventGraphic; diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java index 5bd312a..22e464d 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java @@ -5,7 +5,9 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event; +import com.fourisland.fourpuzzle.database.Database; import com.fourisland.fourpuzzle.*; +import com.fourisland.fourpuzzle.database.Transitions; import com.fourisland.fourpuzzle.gamestate.mapview.MapViewGameState; import com.fourisland.fourpuzzle.gamestate.mapview.event.specialmove.MoveEvent; import com.fourisland.fourpuzzle.gamestate.mapview.event.specialmove.MoveEventThread; @@ -190,14 +192,14 @@ public class SpecialEvent { { if (!startedTransition) { - Display.transition(Database.getTransition("MapExit")); + Display.transition(Database.getTransition(Transitions.MapExit)); } Game.setGameState(new MapViewGameState(map, x, y)); if (!startedTransition) { - Display.transition(Database.getTransition("MapEnter")); + Display.transition(Database.getTransition(Transitions.MapEnter)); } } diff --git a/src/com/fourisland/fourpuzzle/window/ChoiceWindow.java b/src/com/fourisland/fourpuzzle/window/ChoiceWindow.java index 9da5d60..6a82c6a 100755 --- a/src/com/fourisland/fourpuzzle/window/ChoiceWindow.java +++ b/src/com/fourisland/fourpuzzle/window/ChoiceWindow.java @@ -5,7 +5,10 @@ package com.fourisland.fourpuzzle.window; +import com.fourisland.fourpuzzle.window.SystemGraphic; import com.fourisland.fourpuzzle.Audio; +import com.fourisland.fourpuzzle.database.Database; +import com.fourisland.fourpuzzle.database.Sound; import java.awt.Font; import java.awt.Graphics2D; import java.awt.Rectangle; @@ -106,7 +109,7 @@ public class ChoiceWindow { { if (selected > 0) { - Audio.playSound("Cursor1"); + Audio.playSound(Database.getSound(Sound.MoveCursor)); selected--; } @@ -116,7 +119,7 @@ public class ChoiceWindow { { if (selected < (choices.size()-1)) { - Audio.playSound("Cursor1"); + Audio.playSound(Database.getSound(Sound.MoveCursor)); selected++; } -- cgit 1.4.1