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.");
|
log.info("Intro assets loaded successfully.");
|
||||||
batch = new SpriteBatch();
|
batch = new SpriteBatch();
|
||||||
currentScene = introScene = new Intro();
|
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
|
@Override
|
||||||
|
|||||||
@ -39,8 +39,9 @@ public class Intro extends Scene {
|
|||||||
@Override
|
@Override
|
||||||
public void render(SpriteBatch batch) {
|
public void render(SpriteBatch batch) {
|
||||||
if (System.currentTimeMillis() > endTime + 2000 && endTime != 0) {
|
if (System.currentTimeMillis() > endTime + 2000 && endTime != 0) {
|
||||||
Assets.waitUntilLoaded();
|
|
||||||
if (Game.transition == null) {
|
if (Game.transition == null) {
|
||||||
|
Assets.waitUntilLoaded();
|
||||||
|
Game.mainMenuScene = new MainMenu();
|
||||||
Game.transition = new Transition(this, Game.mainMenuScene, State.MAIN_MENU, 1000);
|
Game.transition = new Transition(this, Game.mainMenuScene, State.MAIN_MENU, 1000);
|
||||||
}
|
}
|
||||||
batch.draw(TEXTURE_BLACK, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
|
batch.draw(TEXTURE_BLACK, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||||
|
|||||||
Reference in New Issue
Block a user