diff --git a/bin/RabiClone.jar b/bin/RabiClone.jar index 422f0d0..fb2e1b8 100644 Binary files a/bin/RabiClone.jar and b/bin/RabiClone.jar differ diff --git a/src/sig/RabiClone.java b/src/sig/RabiClone.java index 9217a12..6ddc54b 100644 --- a/src/sig/RabiClone.java +++ b/src/sig/RabiClone.java @@ -74,7 +74,6 @@ public class RabiClone { RENDERHINTS.put(RenderingHints.KEY_COLOR_RENDERING,RenderingHints.VALUE_COLOR_RENDER_SPEED); RENDERHINTS.put(RenderingHints.KEY_DITHERING,RenderingHints.VALUE_DITHER_DISABLE); RENDERHINTS.put(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_OFF); - RENDERHINTS.put(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR); RENDERHINTS.put(RenderingHints.KEY_RENDERING,RenderingHints.VALUE_RENDER_SPEED); Key.InitializeKeyConversionMap(); @@ -120,25 +119,6 @@ public class RabiClone { KeyBind.poll(); - if (Key.isKeyHeld(KeyEvent.VK_F1)) { - if (level_renderer instanceof EditorRenderer) { - OBJ.remove(level_renderer); - OBJ.add(level_renderer = new LevelRenderer(p)); - StartGame(); - } - } - if (Key.isKeyHeld(KeyEvent.VK_F2)) { - if (!(level_renderer instanceof EditorRenderer)) { - OBJ.clear(); - ResetGame(); - OBJ.add(level_renderer = new EditorRenderer(p)); - } - } - if (Key.isKeyHeld(KeyEvent.VK_F6)) { - OBJ.clear(); - ResetGame(); - OBJ.add(control_settings_menu = new ConfigureControls(p)); - } if (Key.isKeyHeld(KeyEvent.VK_F5) && System.currentTimeMillis() - lastControllerScan > 5000) { CONTROLLERS = ControllerEnvironment.getDefaultEnvironment().rescanControllers(); System.out.println(Arrays.toString(CONTROLLERS)); @@ -193,14 +173,14 @@ public class RabiClone { } } - private static void ResetGame() { + public static void ResetGame() { player = null; level_renderer = null; control_settings_menu = null; // System.gc(); } - private static void StartGame() { + public static void StartGame() { // System.gc(); OBJ.add(player = new Player(p)); //OBJ.add(new Erinoah(p)); diff --git a/src/sig/objects/EditorRenderer.java b/src/sig/objects/EditorRenderer.java index a6d08ac..1e157d3 100644 --- a/src/sig/objects/EditorRenderer.java +++ b/src/sig/objects/EditorRenderer.java @@ -2,11 +2,13 @@ package sig.objects; import java.awt.event.MouseEvent; import java.io.IOException; +import java.awt.event.KeyEvent; import sig.RabiClone; import sig.engine.Action; import sig.engine.Alpha; import sig.engine.Font; +import sig.engine.Key; import sig.engine.MouseScrollValue; import sig.engine.PaletteColor; import sig.engine.Panel; @@ -188,5 +190,10 @@ public class EditorRenderer extends LevelRenderer{ RabiClone.CURRENT_MAP.setBackground(tileX,tileY,Background.values()[(RabiClone.CURRENT_MAP.getBackground(tileX, tileY).ordinal()+1)%Background.values().length]); }break; } + if (Key.isKeyHeld(KeyEvent.VK_F1)) { + RabiClone.OBJ.remove(RabiClone.level_renderer); + RabiClone.OBJ.add(RabiClone.level_renderer = new LevelRenderer(RabiClone.p)); + RabiClone.StartGame(); + } } } diff --git a/src/sig/objects/LevelRenderer.java b/src/sig/objects/LevelRenderer.java index e9b1da3..0f15967 100644 --- a/src/sig/objects/LevelRenderer.java +++ b/src/sig/objects/LevelRenderer.java @@ -1,8 +1,12 @@ package sig.objects; +import java.awt.event.KeyEvent; + import sig.RabiClone; +import sig.engine.Action; import sig.engine.Alpha; import sig.engine.Font; +import sig.engine.Key; import sig.engine.PaletteColor; import sig.engine.Panel; import sig.engine.Sprite; @@ -103,5 +107,19 @@ public class LevelRenderer extends Object{ protected void DrawTransparentTile(double x, double y, Tile tile, Alpha alpha) { Draw_Sprite_Partial_Ext(x,y, tile.getSpriteSheetX()*tile.getTileWidth(), tile.getSpriteSheetY()*tile.getTileHeight(), tile.getTileWidth(), tile.getTileHeight(), getSprite(), alpha, Transform.NONE); } + + @Override + public void KeyPressed(Action a) { + if (Key.isKeyHeld(KeyEvent.VK_F2)) { + RabiClone.OBJ.clear(); + RabiClone.ResetGame(); + RabiClone.OBJ.add(RabiClone.level_renderer = new EditorRenderer(RabiClone.p)); + } + if (Key.isKeyHeld(KeyEvent.VK_F3)) { + RabiClone.OBJ.clear(); + RabiClone.ResetGame(); + RabiClone.OBJ.add(RabiClone.control_settings_menu = new ConfigureControls(RabiClone.p)); + } + } }