chore(scene/intro): handle main menu creation in intro instead of game

This commit is contained in:
2025-09-30 08:06:20 +07:00
parent ec1d2a672c
commit 35bc6e60ab
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ public class Game extends ApplicationAdapter {
log.info("Intro assets loaded successfully.");
batch = new SpriteBatch();
currentScene = introScene = new Intro();
mainMenuScene = new MainMenu();
// By the end of the intro, the main menu scene will be created and assigned to Game.mainMenuScene
}
@Override

View File

@ -39,8 +39,9 @@ public class Intro extends Scene {
@Override
public void render(SpriteBatch batch) {
if (System.currentTimeMillis() > endTime + 2000 && endTime != 0) {
Assets.waitUntilLoaded();
if (Game.transition == null) {
Assets.waitUntilLoaded();
Game.mainMenuScene = new MainMenu();
Game.transition = new Transition(this, Game.mainMenuScene, State.MAIN_MENU, 1000);
}
batch.draw(TEXTURE_BLACK, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);