Package com.csse3200.game.ui.minigames
Class ScoreBoard
java.lang.Object
com.csse3200.game.ui.minigames.ScoreBoard
UI component for displaying the scoreboard for mini-game Snake and BirdieDash
Manages score and medal display with dynamic scaling based on screen size.
-
Constructor Summary
ConstructorsConstructorDescriptionScoreBoard
(int initialScore, MiniGameNames gameName) Creates a new SnakeScoreBoard with the initial score. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes of the scoreboard resources.void
resize()
Adjusts the scoreboard's size and position based on screen size.void
void
updateScore
(int newScore) Updates the score displayed on the scoreboard.
-
Constructor Details
-
ScoreBoard
Creates a new SnakeScoreBoard with the initial score.- Parameters:
initialScore
- The starting score to display.
-
-
Method Details
-
scoreBoardSetUp
public void scoreBoardSetUp() -
updateScore
public void updateScore(int newScore) Updates the score displayed on the scoreboard.- Parameters:
newScore
- The new score to display.
-
resize
public void resize()Adjusts the scoreboard's size and position based on screen size. -
dispose
public void dispose()Disposes of the scoreboard resources.
-