Game mod refactoring.

- Created "GameMod" enum to handle all mod-related actions and store all related data.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2014-07-16 16:01:36 -04:00
parent d5b7ff3516
commit 7a187c4e4f
10 changed files with 223 additions and 134 deletions

View File

@@ -130,6 +130,9 @@ public class Utils {
container.getInput().enableKeyRepeat();
container.setAlwaysRender(true);
int width = container.getWidth();
int height = container.getHeight();
// set the cursor
try {
// hide the native cursor
@@ -141,7 +144,6 @@ public class Utils {
loadCursor();
// create fonts
int height = container.getHeight();
float fontBase;
if (height <= 600)
fontBase = 9f;
@@ -161,8 +163,12 @@ public class Utils {
FONT_SMALL = new TrueTypeFont(font.deriveFont(fontBase), false);
// set default game images
for (GameImage o : GameImage.values())
o.setDefaultImage();
for (GameImage img : GameImage.values())
img.setDefaultImage();
// initialize game mods
for (GameMod mod : GameMod.values())
mod.init(width, height);
// tab image
tab = new Image("selection-tab.png");