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.ScreenDisplays 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.BitmapFontfontprivate DragonBoatRacegameThe game instance.private com.badlogic.gdx.graphics.g2d.GlyphLayoutlayoutprivate com.badlogic.gdx.graphics.g2d.BitmapFontleaderBoardFontprotected java.lang.StringreasonThe 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 voiddispose()voidhide()voidpause()voidrender(float delta)Renders the window to show the end of the game.voidresize(int width, int height)voidresume()voidshow()
-
-
-
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:
showin interfacecom.badlogic.gdx.Screen
-
render
public void render(float delta)
Renders the window to show the end of the game.- Specified by:
renderin interfacecom.badlogic.gdx.Screen- Parameters:
delta- The time passed since the last frame.
-
resize
public void resize(int width, int height)- Specified by:
resizein interfacecom.badlogic.gdx.Screen
-
pause
public void pause()
- Specified by:
pausein interfacecom.badlogic.gdx.Screen
-
resume
public void resume()
- Specified by:
resumein interfacecom.badlogic.gdx.Screen
-
hide
public void hide()
- Specified by:
hidein interfacecom.badlogic.gdx.Screen
-
dispose
public void dispose()
- Specified by:
disposein interfacecom.badlogic.gdx.Screen
-
-