Class GameScreen

java.lang.Object
de.tum.cit.fop.maze.GameScreen
All Implemented Interfaces:
com.badlogic.gdx.Screen

public class GameScreen extends Object implements com.badlogic.gdx.Screen
The GameScreen class is responsible for rendering the gameplay screen. It handles the game logic and rendering of the game elements.
  • Constructor Details

    • GameScreen

      public GameScreen(MazeRunnerGame game)
      Constructor for GameScreen. Initializes the game world, UI, and effects.
      Parameters:
      game - The main game class.
    • GameScreen

      public GameScreen(MazeRunnerGame game, GameScreenMemento memento)
      Constructor for loading a saved game state.
      Parameters:
      game - The main game class.
      memento - The memento containing saved state.
  • Method Details

    • render

      public void render(float delta)
      Specified by:
      render in interface com.badlogic.gdx.Screen
    • getGameField

      public GameField getGameField()
      Gets the current game field.
      Returns:
      The game field.
    • setGameField

      public void setGameField(GameField newGameField)
      Sets a new game field.
      Parameters:
      newGameField - The new game field to set.
    • getPlayer

      public Player getPlayer()
      Gets the player entity.
      Returns:
      The player.
    • resize

      public void resize(int width, int height)
      Specified by:
      resize 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
    • 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
    • dispose

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

      public boolean isPaused()
      Checks if the game is paused.
      Returns:
      True if paused.
    • setPaused

      public void setPaused(boolean paused)
      Sets the pause state of the game.
      Parameters:
      paused - True to pause, false to unpause.
    • getSoundController

      public SoundController getSoundController()
      Gets the sound controller.
      Returns:
      The sound controller.
    • getHUD

      public HUD getHUD()
      Gets the HUD.
      Returns:
      The HUD.
    • getGameController

      public GameController getGameController()
      Gets the game controller.
      Returns:
      The game controller.
    • loadNextStoryLevel

      public void loadNextStoryLevel()
      Loads the next level in story mode. Triggers win screen if all levels are completed.
    • getCamera

      public Camera getCamera()
      Gets the camera.
      Returns:
      The camera.
    • getViewport

      public com.badlogic.gdx.utils.viewport.Viewport getViewport()
      Gets the viewport.
      Returns:
      The viewport.
    • getAchievementUI

      public AchievementUI getAchievementUI()
      Gets the achievement UI.
      Returns:
      The achievement UI.
    • saveGame

      public void saveGame()
      Saves the current game state.