Package com.csse3200.game.screens
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionMainGameScreen(GdxGame game) MainGameScreen(GdxGame game, MainGameScreen.Areas area) -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Returns the current game area instanceGet the GameArea mapped to the Areas area.Get the GameArea name mapped to the current gameAreaEnum.Get the Areas area that follows the current Areas game area.booleanisPaused()voidonGameAreaReset(Entity player) voidpause()voidvoidrender(float delta) voidreset()Reset game area and re-add player's death listenervoidresize(int width, int height) voidresume()voidswitchAreaRunnable(MainGameScreen.Areas area, Entity player) Performs the actual area swap to the given target.voidvoidMethods inherited from class com.badlogic.gdx.ScreenAdapter
hide, show
-
Constructor Details
-
MainGameScreen
-
MainGameScreen
-
-
Method Details
-
getAreaEnum
-
getGameAreaName
Get the GameArea name mapped to the current gameAreaEnum.- Returns:
- GameArea mapped.
-
getGameArea
Get the GameArea mapped to the Areas area.- Parameters:
area- - Areas area.- Returns:
- GameArea mapped.
-
getNextArea
Get the Areas area that follows the current Areas game area.- Parameters:
area- - Current Areas game area.- Returns:
- next Areas game area.
-
switchAreaRunnable
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 enumplayer- the player entity to transfer to the new area, may be null
-
getGameArea
Returns the current game area instance- Returns:
- the current game area instance.
-
render
public void render(float delta) - Specified by:
renderin interfacecom.badlogic.gdx.Screen- Overrides:
renderin classcom.badlogic.gdx.ScreenAdapter
-
resize
public void resize(int width, int height) - Specified by:
resizein interfacecom.badlogic.gdx.Screen- Overrides:
resizein classcom.badlogic.gdx.ScreenAdapter
-
pause
public void pause()- Specified by:
pausein interfacecom.badlogic.gdx.Screen- Overrides:
pausein classcom.badlogic.gdx.ScreenAdapter
-
resume
public void resume()- Specified by:
resumein interfacecom.badlogic.gdx.Screen- Overrides:
resumein classcom.badlogic.gdx.ScreenAdapter
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Specified by:
disposein interfacecom.badlogic.gdx.Screen- Overrides:
disposein classcom.badlogic.gdx.ScreenAdapter
-
isPaused
public boolean isPaused() -
togglePaused
public void togglePaused() -
reset
public void reset()Reset game area and re-add player's death listener -
onGameAreaReset
-