Player die show gameoverscreen, total points collected and back to main menu button. - UQdeco2800/2021-ext-studio-2 GitHub Wiki
Overview
The main part of this feature is located in MainMenuActions.java, GameOverDisplay.java, MainGameScreen.java. This allows when the player dies (health = 0) to show game over screen. When the game over screen shows up, player can see total points collected. Also player can choose to play again or back to the main menu.
Logic section
Back to the main menu button
-
we declare a new button: "mainMenuButton" and with mainMenuButton.ADDListener(), player can choose to come back to main menu when the character die and gameover screen show up.
-
This similar with "playAgainButton" to choose to play again.
-
Also we when onGameOver() in MainMenuActions.java launch and show game over screen.
Connect with Scoring system (team9) to show total points collected when game overcreen show up.
-
The situation is when player is dead. The scoring system check if health values is less than zero in the
PlayerStatusDisplay
update player health value method. If true then stop the timer => we have the total score. note: because time so the return type is long. -
In GameOverDisplay.Java we call "ScoringSystemV1" and use "getScore" method to show the total score player collected until dead.
Connect with Health system (team2,Issue 35) to show game overscreen when health=0 -> player dead.
-
Call "CombatStatsCompomemt" to have the health status of the character.
-
Create playerStats.isDead() to display game overcreen when health return to zero.
Display Section
- Like every game overscreen when it pop-ups . We have " game over " title on top, below that is "points" to show points collected, click to main menu button to return to main menu, click to play again to play again.
- Buttons is paint with green collor.
Future implementations
In the following sprints. We might need to layout and fix to get a better-looking game overscreen. Also, add other functions if needed such as view rankings, save game,....