Package de.tum.cit.ase.maze
Class MazeRunnerGame
java.lang.Object
com.badlogic.gdx.Game
de.tum.cit.ase.maze.MazeRunnerGame
- All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener
public class MazeRunnerGame
extends com.badlogic.gdx.Game
The MazeRunnerGame class represents the core of the Maze Runner game.
It manages the screens and global resources like SpriteBatch and Skin.
-
Field Summary
Fields inherited from class com.badlogic.gdx.Game
screen
-
Constructor Summary
ConstructorDescriptionMazeRunnerGame
(games.spooky.gdx.nativefilechooser.NativeFileChooser fileChooser) Constructor for MazeRunnerGame. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the game is created.void
dispose()
Cleans up resources when the game is disposed.games.spooky.gdx.nativefilechooser.NativeFileChooser
int
com.badlogic.gdx.scenes.scene2d.ui.Skin
getSkin()
com.badlogic.gdx.graphics.g2d.SpriteBatch
com.badlogic.gdx.graphics.g2d.SpriteCache
long
void
Clears the sprite cache, stops and disposes the current background music, and sets a new background music for the defeat screen.void
Resizes the game window to 80% of the display mode width and height, sets it to decorated mode, stops the background music, and switches the screen to the Editor screen.void
goToGame
(boolean fromPause) Switches to the game screen.void
goToMenu()
Switches to the menu screen.void
Switches the game to the pause screen.void
Switches to the victory screen.void
void
setGameTime
(int time) Methods inherited from class com.badlogic.gdx.Game
getScreen, pause, render, resize, resume, setScreen
-
Field Details
-
backgroundMusic
protected com.badlogic.gdx.audio.Music backgroundMusic
-
-
Constructor Details
-
MazeRunnerGame
public MazeRunnerGame(games.spooky.gdx.nativefilechooser.NativeFileChooser fileChooser) Constructor for MazeRunnerGame.- Parameters:
fileChooser
- The file chooser for the game, typically used in desktop environment.
-
-
Method Details
-
create
public void create()Called when the game is created. Initializes the SpriteBatch and Skin. -
goToEditor
public void goToEditor()Resizes the game window to 80% of the display mode width and height, sets it to decorated mode, stops the background music, and switches the screen to the Editor screen. -
quitEditor
public void quitEditor() -
goToMenu
public void goToMenu()Switches to the menu screen. -
goToVictoryScreen
public void goToVictoryScreen()Switches to the victory screen. -
goToDefeatScreen
public void goToDefeatScreen()Clears the sprite cache, stops and disposes the current background music, and sets a new background music for the defeat screen. It then sets the current screen to DefeatScreen. If the game screen exists, it disposes it. -
goToGame
public void goToGame(boolean fromPause) Switches to the game screen. -
goToPause
public void goToPause()Switches the game to the pause screen. Stops and disposes the current background music, sets a new background music for the pause screen, and sets the current screen to the PauseScreen. -
dispose
public void dispose()Cleans up resources when the game is disposed.- Specified by:
dispose
in interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
dispose
in classcom.badlogic.gdx.Game
-
getSkin
public com.badlogic.gdx.scenes.scene2d.ui.Skin getSkin() -
getSpriteBatch
public com.badlogic.gdx.graphics.g2d.SpriteBatch getSpriteBatch() -
getSpriteCache
public com.badlogic.gdx.graphics.g2d.SpriteCache getSpriteCache() -
getFileChooser
public games.spooky.gdx.nativefilechooser.NativeFileChooser getFileChooser() -
getStartTime
public long getStartTime() -
setGameTime
public void setGameTime(int time) -
getGameTime
public int getGameTime()
-