Class MainGameScreen

java.lang.Object
com.badlogic.gdx.ScreenAdapter
com.csse3200.game.screens.MainGameScreen
All Implemented Interfaces:
com.badlogic.gdx.Screen, com.badlogic.gdx.utils.Disposable

public class MainGameScreen extends com.badlogic.gdx.ScreenAdapter
The game screen containing the main game.

Details on libGDX screens: https://happycoding.io/tutorials/libgdx/game-screens

  • Constructor Details

  • Method Details

    • getAreaEnum

      public MainGameScreen.Areas getAreaEnum()
    • getGameAreaName

      public String getGameAreaName()
      Get the GameArea name mapped to the current gameAreaEnum.
      Returns:
      GameArea mapped.
    • getGameArea

      public GameArea getGameArea(MainGameScreen.Areas area)
      Get the GameArea mapped to the Areas area.
      Parameters:
      area - - Areas area.
      Returns:
      GameArea mapped.
    • getNextArea

      public MainGameScreen.Areas getNextArea(MainGameScreen.Areas area)
      Get the Areas area that follows the current Areas game area.
      Parameters:
      area - - Current Areas game area.
      Returns:
      next Areas game area.
    • switchAreaRunnable

      public void switchAreaRunnable(MainGameScreen.Areas area, Entity player)
      Performs the actual area swap to the given target. Disposes the old area, creates the new one (with player if provided), and re-registers all global listeners for events.
      Parameters:
      area - the target area enum
      player - the player entity to transfer to the new area, may be null
    • getGameArea

      public GameArea getGameArea()
      Returns the current game area instance
      Returns:
      the current game area instance.
    • render

      public void render(float delta)
      Specified by:
      render in interface com.badlogic.gdx.Screen
      Overrides:
      render in class com.badlogic.gdx.ScreenAdapter
    • resize

      public void resize(int width, int height)
      Specified by:
      resize in interface com.badlogic.gdx.Screen
      Overrides:
      resize in class com.badlogic.gdx.ScreenAdapter
    • pause

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

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

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Specified by:
      dispose in interface com.badlogic.gdx.Screen
      Overrides:
      dispose in class com.badlogic.gdx.ScreenAdapter
    • isPaused

      public boolean isPaused()
    • togglePaused

      public void togglePaused()
    • togglePauseMenu

      public void togglePauseMenu(PauseMenuDisplay.Tab tab)
    • reset

      public void reset()
      Reset game area and re-add player's death listener
    • onGameAreaReset

      public void onGameAreaReset(Entity player)
    • reflectPauseTabClick

      public void reflectPauseTabClick(PauseMenuDisplay.Tab tab)