Package com.csse3200.game
Class GdxGame
java.lang.Object
com.badlogic.gdx.Game
com.csse3200.game.GdxGame
- All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener
public class GdxGame
extends com.badlogic.gdx.Game
Entry point of the non-platform-specific game logic. Controls which screen is currently running.
The current screen triggers transitions to other screens. This works similarly to a finite state
machine (See the State Pattern).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
static enum
-
Field Summary
Fields inherited from class com.badlogic.gdx.Game
screen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
void
dispose()
void
exit()
Exit the game.Get the current cutscene being displayed.Get the previous game's screencom.badlogic.gdx.Screen
Get the previous game's screenvoid
setCurrentCutscene
(Cutscene cutscene) Set the current cutscene being displayed.void
setScreen
(GdxGame.ScreenType screenType) Sets the game's screen to a new screen of the provided type.void
setScreen
(GdxGame.ScreenType screenType, GdxGame.CutsceneType cutsceneType) Methods inherited from class com.badlogic.gdx.Game
getScreen, pause, render, resize, resume, setScreen
-
Constructor Details
-
GdxGame
public GdxGame()
-
-
Method Details
-
create
public void create() -
setScreen
Sets the game's screen to a new screen of the provided type.- Parameters:
screenType
- screen type
-
setScreen
-
getPreviousScreen
public com.badlogic.gdx.Screen getPreviousScreen()Get the previous game's screen- Returns:
- previous screen
-
getCurrentScreenType
Get the previous game's screen- Returns:
- previous screen
-
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
dispose
in classcom.badlogic.gdx.Game
-
setCurrentCutscene
Set the current cutscene being displayed.- Parameters:
cutscene
- The active cutscene.
-
getCurrentCutscene
Get the current cutscene being displayed.- Returns:
- The active cutscene.
-
exit
public void exit()Exit the game.
-