Class GameOverScreen

java.lang.Object
com.skloch.game.GameOverScreen
All Implemented Interfaces:
com.badlogic.gdx.Screen

public class GameOverScreen extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    (package private) com.badlogic.gdx.graphics.OrthographicCamera
     
    private HustleGame
     
    (package private) com.badlogic.gdx.scenes.scene2d.Stage
     
    (package private) com.badlogic.gdx.utils.viewport.Viewport
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GameOverScreen(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

    Modifier and Type
    Method
    Description
    void
     
    void
     
    void
     
    void
    render(float delta)
    Renders the screen and the background each frame
    void
    resize(int width, int height)
    Correctly resizes the onscreen elements when the window is resized
    void
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • game

      private HustleGame 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

      public GameOverScreen(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
      Parameters:
      game - An instance of HustleGame
      hoursStudied - The hours studied in the playthrough
      hoursRecreational - The hours of fun had in the playthrough
      hoursSlept - The hours slept in the playthrough
  • Method Details

    • render

      public void render(float delta)
      Renders the screen and the background each frame
      Specified by:
      render in interface com.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:
      resize in interface com.badlogic.gdx.Screen
      Parameters:
      width -
      height -
    • show

      public void show()
      Specified by:
      show in interface com.badlogic.gdx.Screen
    • hide

      public void hide()
      Specified by:
      hide in interface com.badlogic.gdx.Screen
    • pause

      public void pause()
      Specified by:
      pause in interface com.badlogic.gdx.Screen
    • resume

      public void resume()
      Specified by:
      resume in interface com.badlogic.gdx.Screen
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.Screen