diff --git a/src/sk/bytecode/bludisko/rt/game/math/MathUtils.java b/src/sk/bytecode/bludisko/rt/game/math/MathUtils.java index ba69434..719ef95 100644 --- a/src/sk/bytecode/bludisko/rt/game/math/MathUtils.java +++ b/src/sk/bytecode/bludisko/rt/game/math/MathUtils.java @@ -82,29 +82,4 @@ public static int clamp(int value, int min, int max) { return Math.min(Math.max(value, min), max); } - /** - * Clamps a value between two values, rounding them to min/max if they exceed - * the interval, or returning the same value if it's inside the interval. - * @param value Value to clamp - * @param min Lower bound of the interval - * @param max Upper bound of the interval - * @return Clamped number - */ - public static float clamp(float value, float min, float max) { - return Math.min(Math.max(value, min), max); - } - - /** - * Re-maps a number from one range to another. - * @param x The number to map - * @param fromLowest Smallest value of the input range - * @param fromHighest Highest value of the input range - * @param toLowest Smallest value of the output range - * @param toHighest Highest value of the output range - * @return Value scaled from one range to another one - */ - public static float map(float x, float fromLowest, float fromHighest, float toLowest, float toHighest) { - return (x - fromLowest) * (toHighest - toLowest) / (fromHighest - fromLowest) + toLowest; - } - } diff --git a/src/sk/bytecode/bludisko/rt/game/window/Window.java b/src/sk/bytecode/bludisko/rt/game/window/Window.java index aa16be7..81e04a5 100644 --- a/src/sk/bytecode/bludisko/rt/game/window/Window.java +++ b/src/sk/bytecode/bludisko/rt/game/window/Window.java @@ -6,14 +6,21 @@ import sk.bytecode.bludisko.rt.game.util.NullSafe; import sk.bytecode.bludisko.rt.game.window.screens.Screen; -import javax.swing.*; -import java.awt.*; +import javax.swing.JFrame; +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Point; +import java.awt.Rectangle; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.image.BufferStrategy; import java.awt.image.BufferedImage; import java.util.ArrayDeque; -import java.util.Queue; /** * Main application window containing a {@link Canvas} to be drawn on. @@ -38,8 +45,8 @@ public final class Window { private final Canvas canvas; private final JFrame frame; + private final ArrayDeque screenQueue; private Screen screen; - private ArrayDeque screenQueue; private InputManager inputManager; diff --git a/src/sk/bytecode/bludisko/rt/game/window/screens/GameScreen.java b/src/sk/bytecode/bludisko/rt/game/window/screens/GameScreen.java index 9c5e5cf..4895e3e 100644 --- a/src/sk/bytecode/bludisko/rt/game/window/screens/GameScreen.java +++ b/src/sk/bytecode/bludisko/rt/game/window/screens/GameScreen.java @@ -52,11 +52,6 @@ private void setupPlayer() { camera = new Camera(); overlay = new Overlay(); - // camera.setMap(currentWorld.getMap()); - // camera.move(player.getPosition().cpy().add(2, 1)); - // camera.rotate(270, 100); - // camera.move(500); - player.setCamera(camera); overlay.connectPlayer(player);