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 Classes -
Field Summary
FieldsFields inherited from class com.badlogic.gdx.Game
screen -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()voiddispose()voidexit()Exit the game.static SaveConfigloadSave(String path, FileLoader.Location location) Return a valid save configstatic voidsaveLevel(MainGameScreen.Areas area, Entity player, String path, FileLoader.Location location) voidsetScreen(GdxGame.ScreenType screenType) Sets the game's screen to a new screen of the provided type.Methods inherited from class com.badlogic.gdx.Game
getScreen, pause, render, resize, resume, setScreen
-
Field Details
-
SAVE_PATH
-
-
Constructor Details
-
GdxGame
public GdxGame()
-
-
Method Details
-
create
public void create() -
saveLevel
public static void saveLevel(MainGameScreen.Areas area, Entity player, String path, FileLoader.Location location) -
setScreen
Sets the game's screen to a new screen of the provided type.- Parameters:
screenType- screen type
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.ApplicationListener- Overrides:
disposein classcom.badlogic.gdx.Game
-
loadSave
Return a valid save config- Parameters:
path- - save file path- Returns:
- valid SaveConfig
-
exit
public void exit()Exit the game.
-