Enable rotating player with left CTRL

This commit is contained in:
2022-08-17 14:28:03 +02:00
parent 7acbc45663
commit 60132d1bea

View File

@@ -41,14 +41,26 @@ public abstract class BaseMapHandler implements MapHandler {
return;
}
if(input.isKeyPressed(Key.KEY_DOWN)) {
mainLayer.pushMovement(player.prepareMovement(Direction.DOWN));
} else if(input.isKeyPressed(Key.KEY_UP)) {
mainLayer.pushMovement(player.prepareMovement(Direction.UP));
} else if(input.isKeyPressed(Key.KEY_LEFT)) {
mainLayer.pushMovement(player.prepareMovement(Direction.LEFT));
} else if(input.isKeyPressed(Key.KEY_RIGHT)) {
mainLayer.pushMovement(player.prepareMovement(Direction.RIGHT));
if(input.isKeyPressed(Key.KEY_LEFT_CONTROL)) {
if(input.isKeyPressed(Key.KEY_DOWN)) {
player.setFaceDirection(Direction.DOWN);
} else if(input.isKeyPressed(Key.KEY_UP)) {
player.setFaceDirection(Direction.UP);
} else if(input.isKeyPressed(Key.KEY_LEFT)) {
player.setFaceDirection(Direction.LEFT);
} else if(input.isKeyPressed(Key.KEY_RIGHT)) {
player.setFaceDirection(Direction.RIGHT);
}
} else {
if(input.isKeyPressed(Key.KEY_DOWN)) {
mainLayer.pushMovement(player.prepareMovement(Direction.DOWN));
} else if(input.isKeyPressed(Key.KEY_UP)) {
mainLayer.pushMovement(player.prepareMovement(Direction.UP));
} else if(input.isKeyPressed(Key.KEY_LEFT)) {
mainLayer.pushMovement(player.prepareMovement(Direction.LEFT));
} else if(input.isKeyPressed(Key.KEY_RIGHT)) {
mainLayer.pushMovement(player.prepareMovement(Direction.RIGHT));
}
}
}