Package com.csse3200.game.screens
Class PlanetScreen
java.lang.Object
com.badlogic.gdx.ScreenAdapter
com.csse3200.game.screens.PlanetScreen
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class PlanetScreen
extends com.badlogic.gdx.ScreenAdapter
A screen that represents a single planet of the game with its corresponding game area/s.
Determines which game area to generate and the next planet in the chain.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlanetScreen(GdxGame game) Construct the PlanetScreen instance for the first planet (Earth).PlanetScreen(GdxGame game, String name) Construct the PlanetScreen instance for the planet of given name. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Dispose of the entire game screen.voiddispose()Do not dispose of all services and renderers on screen switch.Get the next planet in the sequence after the current planet.voidpause()voidrender(float delta) voidresize(int width, int height) voidresume()voidsetCurrentArea(String name) Sets the current game area the player is on.voidshow()Create the screen services and game areas on show.Methods inherited from class com.badlogic.gdx.ScreenAdapter
hide
-
Field Details
-
name
-
-
Constructor Details
-
PlanetScreen
Construct the PlanetScreen instance for the first planet (Earth).- Parameters:
game- The current game instance to display screen on.
-
PlanetScreen
Construct the PlanetScreen instance for the planet of given name.- Parameters:
game- The current game instance to display screen on.name- The name of the planet to create a screen for.
-
-
Method Details
-
show
public void show()Create the screen services and game areas on show.- Specified by:
showin interfacecom.badlogic.gdx.Screen- Overrides:
showin classcom.badlogic.gdx.ScreenAdapter
-
getNextPlanet
Get the next planet in the sequence after the current planet.- Returns:
- The PlanetScreen instance for the next planet.
-
setCurrentArea
Sets the current game area the player is on.- Parameters:
name- The name of the game area.
-
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()Do not dispose of all services and renderers on screen switch. Preserve state- Specified by:
disposein interfacecom.badlogic.gdx.Screen- Overrides:
disposein classcom.badlogic.gdx.ScreenAdapter
-
clear
public void clear()Dispose of the entire game screen.
-