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 newMapStatus
    static float getSlowPlayerTime()
    getter method of slowPlayerTime
    static boolean isSlowPlayer()
    getter method of slowPlayer
    void pause()  
    void render​(float delta)  
    void resize​(int width, int height)  
    void resume()  
    static void setNewMapStatus​(MainGameScreen.NewMap status)
    setter method of newMapStatus
    static void setSlowPlayer​(boolean slowPlayer)
    setter method of slowPlayer
    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().
    static void setSlowPlayerTime​(float slowPlayerTime)
    setter method of slowPlayerTime

    Methods inherited from class com.badlogic.gdx.ScreenAdapter

    hide, show

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static MainGameScreen.NewMap getNewMapStatus()
      getter method of newMapStatus
      Returns:
      the status of mew map
    • setNewMapStatus

      public static void setNewMapStatus​(MainGameScreen.NewMap status)
      setter method of newMapStatus
      Parameters:
      status - the status of mew map
    • render

      public void render​(float delta)
      Specified by:
      render in interface Screen
      Overrides:
      render in class ScreenAdapter
    • resize

      public void resize​(int width, int height)
      Specified by:
      resize in interface Screen
      Overrides:
      resize in class ScreenAdapter
    • pause

      public void pause()
      Specified by:
      pause in interface Screen
      Overrides:
      pause in class ScreenAdapter
    • resume

      public void resume()
      Specified by:
      resume in interface Screen
      Overrides:
      resume in class ScreenAdapter
    • dispose

      public void dispose()
      Specified by:
      dispose in interface Screen
      Overrides:
      dispose in class ScreenAdapter