Package com.dragonboatrace.screens
Class RoundsScreen
- java.lang.Object
-
- com.dragonboatrace.screens.RoundsScreen
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class RoundsScreen extends java.lang.Object implements com.badlogic.gdx.Screen
Represents the intermediary screen between rounds that shows the player their place in the previous race and waits for the user to continue on to the next round.
-
-
Field Summary
Fields Modifier and Type Field Description private int
currentRound
The current round of the game.private com.badlogic.gdx.graphics.g2d.BitmapFont
font
private DragonBoatRace
game
The instance of the game.private com.badlogic.gdx.graphics.g2d.GlyphLayout
layout
private com.badlogic.gdx.graphics.g2d.BitmapFont
leaderBoardFont
private Boat
playerBoat
The instance of the players boat to bring through each round.private java.lang.String
reason
The leaderboard to display the places of the boats in the race.
-
Constructor Summary
Constructors Constructor Description RoundsScreen(DragonBoatRace game, Boat playerBoat, java.lang.String reason)
Creates a new screen to display the leaderboard from the previous round.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
void
hide()
void
pause()
void
render(float delta)
Render the screen to show the leaderboard of all the boats in the round and their positions.void
resize(int width, int height)
void
resume()
void
show()
-
-
-
Field Detail
-
game
private final DragonBoatRace game
The instance of the game.
-
currentRound
private final int currentRound
The current round of the game.
-
playerBoat
private final Boat playerBoat
The instance of the players boat to bring through each round.
-
reason
private final java.lang.String reason
The leaderboard to display the places of the boats in the race.
-
font
private final com.badlogic.gdx.graphics.g2d.BitmapFont font
-
layout
private final com.badlogic.gdx.graphics.g2d.GlyphLayout layout
-
leaderBoardFont
private com.badlogic.gdx.graphics.g2d.BitmapFont leaderBoardFont
-
-
Constructor Detail
-
RoundsScreen
public RoundsScreen(DragonBoatRace game, Boat playerBoat, java.lang.String reason)
Creates a new screen to display the leaderboard from the previous round.- Parameters:
game
- The game instance.playerBoat
- The players boat to bring through each round.reason
- The string that represents the positions of the boats in the round that just finished.
-
-
Method Detail
-
show
public void show()
- Specified by:
show
in interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Render the screen to show the leaderboard of all the boats in the round and their positions.- Specified by:
render
in interfacecom.badlogic.gdx.Screen
- Parameters:
delta
- The time passed since the last frame.
-
resize
public void resize(int width, int height)
- Specified by:
resize
in interfacecom.badlogic.gdx.Screen
-
pause
public void pause()
- Specified by:
pause
in interfacecom.badlogic.gdx.Screen
-
resume
public void resume()
- Specified by:
resume
in interfacecom.badlogic.gdx.Screen
-
hide
public void hide()
- Specified by:
hide
in interfacecom.badlogic.gdx.Screen
-
dispose
public void dispose()
- Specified by:
dispose
in interfacecom.badlogic.gdx.Screen
-
-