Package com.dragonboatrace.screens
Class GameOverScreen
- java.lang.Object
-
- com.dragonboatrace.screens.GameOverScreen
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class GameOverScreen extends java.lang.Object implements com.badlogic.gdx.Screen
Displays the screen that shows the end of the game. This can be one of 3 situations:- If the player got to the final and finished the race.
- The player didn't make it to the final after the 3rd round.
- The players boat ran out of health.
-
-
Field Summary
Fields Modifier and Type Field Description private com.badlogic.gdx.graphics.g2d.BitmapFont
font
private DragonBoatRace
game
The game instance.private com.badlogic.gdx.graphics.g2d.GlyphLayout
layout
private com.badlogic.gdx.graphics.g2d.BitmapFont
leaderBoardFont
protected java.lang.String
reason
The reason for the game to be over.
-
Constructor Summary
Constructors Constructor Description GameOverScreen(DragonBoatRace game, java.lang.String reason)
Creates a new screen that represents the end of the game to the player.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
void
hide()
void
pause()
void
render(float delta)
Renders the window to show the end of the game.void
resize(int width, int height)
void
resume()
void
show()
-
-
-
Field Detail
-
game
private final DragonBoatRace game
The game instance.
-
reason
protected java.lang.String reason
The reason for the game to be over.
-
font
private final com.badlogic.gdx.graphics.g2d.BitmapFont font
-
leaderBoardFont
private com.badlogic.gdx.graphics.g2d.BitmapFont leaderBoardFont
-
layout
private final com.badlogic.gdx.graphics.g2d.GlyphLayout layout
-
-
Constructor Detail
-
GameOverScreen
public GameOverScreen(DragonBoatRace game, java.lang.String reason)
Creates a new screen that represents the end of the game to the player.- Parameters:
game
- The instance of the game.reason
- The reason for the game to be over.
-
-
Method Detail
-
show
public void show()
- Specified by:
show
in interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the window to show the end of the game.- 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
-
-