public void createMainMenuScene() { final MainMenuResourcesManager menuResourcesManager = (MainMenuResourcesManager) resourceManagerMap.get(SceneType.MENU); final IResourcesManager loadingResourcesManger = resourceManagerMap.get(SceneType.LOADING); menuResourcesManager.loadResources(); menuResourcesManager.loadFonts(); loadingResourcesManger.loadResources(); menuScene = new MainMenuScene(menuResourcesManager); menuScene.createScene(); loadingScene = new LoadingScene(loadingResourcesManger); loadingScene.createScene(); setScene(menuScene); disposeSplashScene(); showAppRating(); }
public void loadMenuScene(BaseScene scene) { Log.i(TAG, ">> Loading menu scene"); setScene(loadingScene); scene.disposeScene(); engine.registerUpdateHandler( new TimerHandler( ContextConstants.LOADING_SCENE_TIME, new ITimerCallback() { @Override public void onTimePassed(TimerHandler pTimerHandler) { engine.unregisterUpdateHandler(pTimerHandler); resourceManagerMap.get(SceneType.MENU).loadResources(); setScene(menuScene); Log.i(TAG, "<< Loading menu scene finished"); } })); }
public void loadGameScene() { Log.i(TAG, ">> Loading game scene"); setScene(loadingScene); engine.registerUpdateHandler( new TimerHandler( ContextConstants.LOADING_SCENE_TIME, new ITimerCallback() { @Override public void onTimePassed(TimerHandler pTimerHandler) { engine.unregisterUpdateHandler(pTimerHandler); resourceManagerMap.get(SceneType.SINGLE_PLAYER_GAME).loadResources(); gameScene = new GameScene(resourceManagerMap.get(SceneType.SINGLE_PLAYER_GAME)); gameScene.createScene(); setScene(gameScene); Log.i(TAG, "<< Loading game scene finished"); } })); }
public void loadHighScoreSceneFrom() { Log.i(TAG, ">> Loading highscore scene "); setScene(loadingScene); engine.registerUpdateHandler( new TimerHandler( ContextConstants.LOADING_SCENE_TIME / 2, new ITimerCallback() { @Override public void onTimePassed(TimerHandler pTimerHandler) { engine.unregisterUpdateHandler(pTimerHandler); resourceManagerMap.get(SceneType.RECORDS).loadResources(); recordScene = new HighScoreScene(resourceManagerMap.get(SceneType.RECORDS)); recordScene.createScene(); setScene(recordScene); } })); Log.i(TAG, "<< Loading highscore scene finished"); }