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