Repository navigation
Win Game Screen
The win screen appears after the final boss ending dialogue is completed.
It displays a victory animation, plays win music and allows the player to return to the main menu.
The final dialogue is handled by FinalBossEndingDialogueComponent.
Also, can be triggered using the key combo-> Cntrl + Shift + W
After the player advances past the final dialogue line, the component triggers:
target.getEvents().trigger("winScreenRequested");The target is the player entity.
MainGameScreen listens for the event and stores a request flag. After the entity update completes, it changes to the win screen:
if (winScreenRequested) {
winScreenRequested = false;
game.setScreen(ScreenType.WIN_SCREEN);
return;
}Delaying the transition until after the entity update prevents the game screen from being disposed while dialogue input is still being processed.
WinScreen:
-
Loads
images/win_dance.gif -
Plays
sounds/win_music.mp3 -
Displays the
YOU WIN!title - Loops the victory animation
- Provides a Main Menu button
The screen is opened with:
game.setScreen(GdxGame.ScreenType.WIN_SCREEN);The Main Menu button changes the screen back to:
game.setScreen(GdxGame.ScreenType.MAIN_MENU);When the win screen closes, it disposes the win music, GIF textures, renderer and services.