Package com.skloch.game
Class GameOverScreen
java.lang.Object
com.skloch.game.GameOverScreen
- All Implemented Interfaces:
com.badlogic.gdx.Screen
A screen that displays the player's stats at the end of the game.
Currently doesn't calculate a score
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) com.badlogic.gdx.graphics.OrthographicCameraprivate HustleGame(package private) com.badlogic.gdx.scenes.scene2d.Stage(package private) com.badlogic.gdx.utils.viewport.Viewport -
Constructor Summary
ConstructorsConstructorDescriptionGameOverScreen(HustleGame game, int hoursStudied, int hoursRecreational, int hoursSlept) A screen to display a 'Game Over' screen when the player finishes their exams Currently does not calculate a score, just shows the player's stats to them, as requested in assessment 1 Tracking them now will make win conditions easier to implement for assessment 2 -
Method Summary
-
Field Details
-
game
-
gameOverStage
com.badlogic.gdx.scenes.scene2d.Stage gameOverStage -
viewport
com.badlogic.gdx.utils.viewport.Viewport viewport -
camera
com.badlogic.gdx.graphics.OrthographicCamera camera
-
-
Constructor Details
-
GameOverScreen
A screen to display a 'Game Over' screen when the player finishes their exams Currently does not calculate a score, just shows the player's stats to them, as requested in assessment 1 Tracking them now will make win conditions easier to implement for assessment 2- Parameters:
game- An instance of HustleGamehoursStudied- The hours studied in the playthroughhoursRecreational- The hours of fun had in the playthroughhoursSlept- The hours slept in the playthrough
-
-
Method Details
-
render
public void render(float delta) Renders the screen and the background each frame- Specified by:
renderin interfacecom.badlogic.gdx.Screen- Parameters:
delta- The time in seconds since the last render.
-
resize
public void resize(int width, int height) Correctly resizes the onscreen elements when the window is resized- Specified by:
resizein interfacecom.badlogic.gdx.Screen- Parameters:
width-height-
-
show
public void show()- Specified by:
showin interfacecom.badlogic.gdx.Screen
-
hide
public void hide()- Specified by:
hidein 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
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.Screen
-