Package com.mygdx.auber.Screens
Class PlayScreen
- java.lang.Object
-
- com.mygdx.auber.Screens.PlayScreen
-
- All Implemented Interfaces:
com.badlogic.gdx.Screen
public class PlayScreen extends java.lang.Object implements com.badlogic.gdx.Screen
-
-
Constructor Summary
Constructors Constructor Description PlayScreen(Auber currentGame, boolean isDemo, int gameDifficulty)Class constructor.PlayScreen(Auber currentGame, boolean isDemo, java.lang.String path)Class constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebugText()Prints debug text, not used.voiddispose()Called when the screen is closed, need to call dispose methods of classes to ensure no memory leaks.booleangameOver()If any of the game over conditions are true, returns true.booleangameWin()If any of the win conditions are true, returns true.static com.badlogic.gdx.graphics.OrthographicCameragetCamera()The camera used to render the game.intgetMaxIncorrectArrests()Gets the max incorrect arrests.static intgetNumberOfInfiltrators()Gets the number of infiltrators.voidhide()Method implemented from abstract superclass.voidpause()Method implemented from abstract superclass.voidrender(float delta)Called every frame, call render methods in here.voidresize(int width, int height)Called upon window being resized, and at the beginning.voidresume()Method implemented from abstract superclass.voidshow()Method implemented from abstract superclass.voidupdate(float time)Called every frame, call update methods in here.
-
-
-
Constructor Detail
-
PlayScreen
public PlayScreen(Auber currentGame, boolean isDemo, int gameDifficulty)
Class constructor.- Parameters:
currentGame- The currently running instance of the game.isDemo- Whether the game is running in demo mode or not.gameDifficulty- The difficulty of the game.
-
PlayScreen
public PlayScreen(Auber currentGame, boolean isDemo, java.lang.String path)
Class constructor.- Parameters:
currentGame- The currently running instance of the game.isDemo- Whether the game is running in demo mode or not.path- The file path of the game file to be loaded.
-
-
Method Detail
-
show
public void show()
Method implemented from abstract superclass.- Specified by:
showin interfacecom.badlogic.gdx.Screen
-
gameOver
public boolean gameOver()
If any of the game over conditions are true, returns true.- Returns:
- Boolean if the game is over or not
-
gameWin
public boolean gameWin()
If any of the win conditions are true, returns true.- Returns:
- Boolean If the game is won or not.
-
update
public void update(float time)
Called every frame, call update methods in here.- Parameters:
time- Time between last frame and this frame.
-
render
public void render(float delta)
Called every frame, call render methods in here.- Specified by:
renderin interfacecom.badlogic.gdx.Screen- Parameters:
delta- Time between last frame and this frame.
-
resize
public void resize(int width, int height)Called upon window being resized, and at the beginning.- Specified by:
resizein interfacecom.badlogic.gdx.Screen- Parameters:
width- Width of the window.height- Height of the window.
-
pause
public void pause()
Method implemented from abstract superclass.- Specified by:
pausein interfacecom.badlogic.gdx.Screen
-
resume
public void resume()
Method implemented from abstract superclass.- Specified by:
resumein interfacecom.badlogic.gdx.Screen
-
hide
public void hide()
Method implemented from abstract superclass.- Specified by:
hidein interfacecom.badlogic.gdx.Screen
-
dispose
public void dispose()
Called when the screen is closed, need to call dispose methods of classes to ensure no memory leaks.- Specified by:
disposein interfacecom.badlogic.gdx.Screen
-
debugText
public void debugText()
Prints debug text, not used.
-
getMaxIncorrectArrests
public int getMaxIncorrectArrests()
Gets the max incorrect arrests.- Returns:
- An int containing the max incorrect arrests.
-
getNumberOfInfiltrators
public static int getNumberOfInfiltrators()
Gets the number of infiltrators.- Returns:
- An int containing the number of infiltrators.
-
getCamera
public static com.badlogic.gdx.graphics.OrthographicCamera getCamera()
The camera used to render the game.- Returns:
- The camera used to render the game.
-
-