removed warnings
This commit is contained in:
@@ -118,7 +118,7 @@ public class GamePanel extends JPanel implements Runnable {
|
||||
Graphics2D graphics2d = (Graphics2D) graphics;
|
||||
|
||||
// DEBUG
|
||||
long drawStart = 0;
|
||||
long drawStart;
|
||||
drawStart = System.nanoTime();
|
||||
|
||||
// TITLE SCREEN
|
||||
|
||||
@@ -66,7 +66,6 @@ public class UI {
|
||||
|
||||
// RESET
|
||||
x = panel.tileSize / 2;
|
||||
y = panel.tileSize / 2;
|
||||
i = 0;
|
||||
|
||||
// DRAW CURRENT LIFE
|
||||
|
||||
@@ -2,18 +2,9 @@ package de.miaurizius.jgame2d.core.enums;
|
||||
|
||||
public enum Direction {
|
||||
|
||||
UP("up"),
|
||||
DOWN("down"),
|
||||
LEFT("left"),
|
||||
RIGHT("right");
|
||||
UP,
|
||||
DOWN,
|
||||
LEFT,
|
||||
RIGHT;
|
||||
|
||||
private final String name;
|
||||
|
||||
Direction(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ public class KeyHandler implements KeyListener {
|
||||
}
|
||||
break;
|
||||
case DIALOGUE:
|
||||
switch (code) {
|
||||
case KeyEvent.VK_SPACE -> panel.gameState = GameState.PLAY;
|
||||
if (code == KeyEvent.VK_SPACE) {
|
||||
panel.gameState = GameState.PLAY;
|
||||
}
|
||||
break;
|
||||
case TITLE:
|
||||
|
||||
@@ -61,7 +61,7 @@ public class Player extends Entity {
|
||||
if(keyH.upPressed) direction = Direction.UP;
|
||||
else if(keyH.downPressed) direction = Direction.DOWN;
|
||||
else if(keyH.leftPressed) direction = Direction.LEFT;
|
||||
else if(keyH.rightPressed) direction = Direction.RIGHT;
|
||||
else direction = Direction.RIGHT;
|
||||
|
||||
// CHECK TILE COLLISION
|
||||
collisionOn = false;
|
||||
|
||||
Reference in New Issue
Block a user