feat(game): keyboard input handling

This commit is contained in:
2025-10-01 10:15:07 +07:00
parent 381ff306cb
commit 63c81f98c2
2 changed files with 4 additions and 5 deletions

View File

@ -84,11 +84,6 @@ public class Game extends ApplicationAdapter {
}
}
if (!currentScene.root.isVisible()) {
log.trace("Showing current scene: {}", currentScene.getClass().getSimpleName());
currentScene.root.setVisible(true);
}
batch.begin();
currentScene.render(batch);
batch.end();

View File

@ -44,6 +44,10 @@ public class Transition extends Scene {
log.trace("Transition complete to state: {}", targetState);
game.state = targetState;
game.transition = null;
// Set keyboard focus to the new scene's root
from.root.setVisible(false);
to.root.setVisible(true);
game.stage.setKeyboardFocus(to.root);
return;
}
var fromOpacity = 1 - toOpacity;