chore(scene/intro): handle main menu creation in intro instead of game
This commit is contained in:
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user