Package com.deco2800.game.screens
Class MainGameScreen
java.lang.Object
com.badlogic.gdx.ScreenAdapter
com.deco2800.game.screens.MainGameScreen
- All Implemented Interfaces:
Screen
public class MainGameScreen extends ScreenAdapter
The game screen containing the main game.
Details on libGDX screens: https://happycoding.io/tutorials/libgdx/game-screens
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MainGameScreen.NewMap
all status of new map -
Field Summary
Fields Modifier and Type Field Description static MainGameScreen.NewMap
newMapStatus
static Entity
players
-
Constructor Summary
Constructors Constructor Description MainGameScreen(GdxGame game)
-
Method Summary
Modifier and Type Method Description void
dispose()
static MainGameScreen.NewMap
getNewMapStatus()
getter method of newMapStatusstatic float
getSlowPlayerTime()
getter method of slowPlayerTimestatic boolean
isSlowPlayer()
getter method of slowPlayervoid
pause()
void
render(float delta)
void
resize(int width, int height)
void
resume()
static void
setNewMapStatus(MainGameScreen.NewMap status)
setter method of newMapStatusstatic void
setSlowPlayer(boolean slowPlayer)
setter method of slowPlayerstatic void
setSlowPlayer(float slowPlayerTime)
Set the player deceleration time, the value set in the function is used by slowPlayer(), and the function is implemented in render().static void
setSlowPlayerTime(float slowPlayerTime)
setter method of slowPlayerTime
-
Field Details
-
Constructor Details
-
Method Details
-
isSlowPlayer
public static boolean isSlowPlayer()getter method of slowPlayer- Returns:
- if the player is slow status
-
setSlowPlayer
public static void setSlowPlayer(boolean slowPlayer)setter method of slowPlayer- Parameters:
slowPlayer
- if the player is on a slow status
-
setSlowPlayer
public static void setSlowPlayer(float slowPlayerTime)Set the player deceleration time, the value set in the function is used by slowPlayer(), and the function is implemented in render(). This function called by thornsDisappear() in ObstacleDisappear.java- Parameters:
slowPlayerTime
- How many seconds the player slows down.
-
getSlowPlayerTime
public static float getSlowPlayerTime()getter method of slowPlayerTime- Returns:
- time remain of player slow time
-
setSlowPlayerTime
public static void setSlowPlayerTime(float slowPlayerTime)setter method of slowPlayerTime- Parameters:
slowPlayerTime
- how may time the player will on slow status
-
getNewMapStatus
getter method of newMapStatus- Returns:
- the status of mew map
-
setNewMapStatus
setter method of newMapStatus- Parameters:
status
- the status of mew map
-
render
public void render(float delta)- Specified by:
render
in interfaceScreen
- Overrides:
render
in classScreenAdapter
-
resize
public void resize(int width, int height)- Specified by:
resize
in interfaceScreen
- Overrides:
resize
in classScreenAdapter
-
pause
public void pause()- Specified by:
pause
in interfaceScreen
- Overrides:
pause
in classScreenAdapter
-
resume
public void resume()- Specified by:
resume
in interfaceScreen
- Overrides:
resume
in classScreenAdapter
-
dispose
public void dispose()- Specified by:
dispose
in interfaceScreen
- Overrides:
dispose
in classScreenAdapter
-