This commit is contained in:
2025-12-16 13:00:00 +01:00
parent 39fc7d549a
commit ce3f590715

View File

@@ -327,10 +327,10 @@ public class Entity {
int nextWorldY = user.getTopY();
switch(user.direction) {
case UP -> nextWorldY = user.getTopY()-1;
case DOWN -> nextWorldY = user.getBottomY()+1;
case LEFT -> nextWorldX = user.getLeftX()-1;
case RIGHT -> nextWorldX = user.getRightX()+1;
case UP -> nextWorldY = user.getTopY()-panel.player.speed;
case DOWN -> nextWorldY = user.getBottomY()+panel.player.speed;
case LEFT -> nextWorldX = user.getLeftX()-panel.player.speed;
case RIGHT -> nextWorldX = user.getRightX()+panel.player.speed;
}
int col = nextWorldX / panel.tileSize;
int row = nextWorldY / panel.tileSize;