Package com.dicycat.kroy
Class Kroy
- java.lang.Object
-
- com.badlogic.gdx.Game
-
- com.dicycat.kroy.Kroy
-
- All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener
public class Kroy extends com.badlogic.gdx.Game
Main game class- Author:
- Riju De
-
-
Field Summary
Fields Modifier and Type Field Description com.badlogic.gdx.graphics.g2d.SpriteBatch
batch
static int
height
static GameScreen
mainGameScreen
static MenuScreen
mainMenuScreen
static int
width
-
Constructor Summary
Constructors Constructor Description Kroy()
-
Method Summary
Modifier and Type Method Description void
backToMenu()
Return back to the menu screenstatic int
CentreWidth()
Centre of the screen widthvoid
create()
void
dispose()
java.lang.Integer
getHighScore()
Get the current high scorevoid
newGame(int truckNum)
Call to generate a brand new GameScreen which runs a new gamevoid
render()
void
setHighScore(java.lang.Integer highScore)
Set the high score
-
-
-
Field Detail
-
width
public static final int width
- See Also:
- Constant Field Values
-
height
public static final int height
- See Also:
- Constant Field Values
-
mainGameScreen
public static GameScreen mainGameScreen
-
mainMenuScreen
public static MenuScreen mainMenuScreen
-
batch
public com.badlogic.gdx.graphics.g2d.SpriteBatch batch
-
-
Method Detail
-
create
public void create()
-
render
public void render()
- Specified by:
render
in interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
render
in classcom.badlogic.gdx.Game
-
dispose
public void dispose()
- Specified by:
dispose
in interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
dispose
in classcom.badlogic.gdx.Game
-
newGame
public void newGame(int truckNum)
Call to generate a brand new GameScreen which runs a new game- Parameters:
truckNum
- Selected truck
-
backToMenu
public void backToMenu()
Return back to the menu screen
-
CentreWidth
public static int CentreWidth()
Centre of the screen width- Returns:
- centre of the screen width
-
setHighScore
public void setHighScore(java.lang.Integer highScore)
Set the high score- Parameters:
highScore
- The new high score
-
getHighScore
public java.lang.Integer getHighScore()
Get the current high score- Returns:
- highScore
-
-