Package com.dragonboat.game
Class DragonBoatGame
- java.lang.Object
-
- com.badlogic.gdx.Game
-
- com.dragonboat.game.DragonBoatGame
-
- All Implemented Interfaces:
com.badlogic.gdx.ApplicationListener
public class DragonBoatGame extends com.badlogic.gdx.Game
Game Class for Dragon Boat Game.
Initialises all the objects necessary for the game, starts music, creates Lanes, randomises Obstacle spawns, initialises blank Player and Opponents, initialises a Progress Bar and Leaderboard, and instantiates a Difficulty selection screen.
- See Also:
DifficultyScreen
-
-
Field Summary
Fields Modifier and Type Field Description Course
course
protected boolean
debug_norandom
protected boolean
debug_positions
protected boolean
debug_speed
protected boolean
debug_verboseoutput
int
difficulty
protected DifficultyScreen
difficultyScreen
boolean
ended
protected GameScreen
gameScreen
com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator
generator
Lane[]
lanes
Leaderboard
leaderboard
com.badlogic.gdx.audio.Music
music
int
noOfObstacles
java.util.ArrayList<java.lang.Integer>[]
obstacleTimes
Opponent[]
opponents
com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter
parameter
Player
player
int
playerChoice
ProgressBar
progressBar
protected java.util.Random
rnd
int
selectedDifficulty
java.util.HashMap<java.lang.String,com.badlogic.gdx.graphics.Texture>
spriteTextures
-
Constructor Summary
Constructors Constructor Description DragonBoatGame()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advanceLeg()
Changes the screen to a new GameScreen and resets necessary attributes.void
create()
Sets up the game with settings and instantiation of objects.void
dispose()
Disposes of the current screen when it's no longer needed.void
endGame()
Ends the gamecom.badlogic.gdx.graphics.g2d.SpriteBatch
getBatch()
void
render()
Renders the gamevoid
resize(int width, int height)
Resizes the game screen.void
startGame()
Starts the game.
-
-
-
Field Detail
-
debug_speed
protected boolean debug_speed
-
debug_positions
protected boolean debug_positions
-
debug_norandom
protected boolean debug_norandom
-
debug_verboseoutput
protected boolean debug_verboseoutput
-
rnd
protected java.util.Random rnd
-
difficultyScreen
protected DifficultyScreen difficultyScreen
-
gameScreen
protected GameScreen gameScreen
-
lanes
public Lane[] lanes
-
player
public Player player
-
course
public Course course
-
opponents
public Opponent[] opponents
-
progressBar
public ProgressBar progressBar
-
leaderboard
public Leaderboard leaderboard
-
obstacleTimes
public java.util.ArrayList<java.lang.Integer>[] obstacleTimes
-
noOfObstacles
public int noOfObstacles
-
playerChoice
public int playerChoice
-
difficulty
public int difficulty
-
selectedDifficulty
public int selectedDifficulty
-
music
public com.badlogic.gdx.audio.Music music
-
ended
public boolean ended
-
generator
public com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator generator
-
parameter
public com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter parameter
-
spriteTextures
public java.util.HashMap<java.lang.String,com.badlogic.gdx.graphics.Texture> spriteTextures
-
-
Method Detail
-
create
public void create()
Sets up the game with settings and instantiation of objects.
-
advanceLeg
public void advanceLeg()
Changes the screen to a new GameScreen and resets necessary attributes.
-
render
public void render()
Renders the game- Specified by:
render
in interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
render
in classcom.badlogic.gdx.Game
-
endGame
public void endGame()
Ends the game
-
startGame
public void startGame()
Starts the game.
-
resize
public void resize(int width, int height)
Resizes the game screen.- Specified by:
resize
in interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
resize
in classcom.badlogic.gdx.Game
- Parameters:
width
- Width of the screen.height
- Height of the screen.
-
dispose
public void dispose()
Disposes of the current screen when it's no longer needed.- Specified by:
dispose
in interfacecom.badlogic.gdx.ApplicationListener
- Overrides:
dispose
in classcom.badlogic.gdx.Game
-
getBatch
public com.badlogic.gdx.graphics.g2d.SpriteBatch getBatch()
- Returns:
- SpriteBatch representing this game's sprite batch
-
-