@Override public void onUpdate(final float pSecondsElapsed) { if (LevelWonLayer.this.mLayerBG.getY() < ((ResourceManager.getInstance().cameraHeight / 2f) + (LevelWonLayer.this.mLayerBG.getHeight() / 2f))) { LevelWonLayer.this.mLayerBG.setY( Math.min( LevelWonLayer.this.mLayerBG.getY() + (pSecondsElapsed * ManagedLayer.mSLIDE_PIXELS_PER_SECONDS), (ResourceManager.getInstance().cameraHeight / 2f) + (LevelWonLayer.this.mLayerBG.getHeight() / 2f))); } else { ResourceManager.getInstance().engine.unregisterUpdateHandler(this); SceneManager.getInstance().hideLayer(); if (LevelWonLayer.this.mIsGoingToRestartLevel) { LevelWonLayer.this.mCurrentLevel.restartLevel(); return; } else if (LevelWonLayer.this.mIsGoingToNextLevel) { if (Levels.isNextLevelInCurrentWorld(LevelWonLayer.this.mCurrentLevel.mLevelDef)) { LevelWonLayer.this.mCurrentLevel.startNextLevel(); return; } } LevelWonLayer.this.mCurrentLevel.disposeLevel(); SceneManager.getInstance().showMainMenu(); } }
@Override public void onUpdate(final float pSecondsElapsed) { if (OptionsLayer.this.LayerBG.getY() < ((ResourceManager.getInstance().cameraHeight / 2f) + (OptionsLayer.this.LayerBG.getHeight() / 2f))) { OptionsLayer.this.LayerBG.setY( Math.min( OptionsLayer.this.LayerBG.getY() + (pSecondsElapsed * mSLIDE_PIXELS_PER_SECONDS), (ResourceManager.getInstance().cameraHeight / 2f) + (OptionsLayer.this.LayerBG.getHeight() / 2f))); } else { ResourceManager.getInstance().engine.unregisterUpdateHandler(this); SceneManager.getInstance().hideLayer(); } }