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.GameGame 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 Menu Screen.
- See Also:
MenuScreen
-
-
Field Summary
Fields Modifier and Type Field Description Coursecourseintdifficultybooleanendedcom.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorgeneratorLane[]lanesLeaderboardleaderboardcom.badlogic.gdx.audio.MusicmusicintnoOfObstaclesjava.util.ArrayList<java.lang.Integer>[]obstacleTimesOpponent[]opponentscom.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameterparameterPlayerplayerintplayerChoiceProgressBarprogressBar
-
Constructor Summary
Constructors Constructor Description DragonBoatGame()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvanceLeg()Changes the screen to a new GameScreen and resets necessary attributes.voidcreate()Sets up the game with settings and instantiation of objects.voiddispose()Disposes of the current screen when it's no longer needed.voidendGame()voidrender()voidresize(int width, int height)Resizes the game screen.
-
-
-
Field Detail
-
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
-
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
-
-
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()
- Specified by:
renderin interfacecom.badlogic.gdx.ApplicationListener- Overrides:
renderin classcom.badlogic.gdx.Game
-
endGame
public void endGame()
-
resize
public void resize(int width, int height)Resizes the game screen.- Specified by:
resizein interfacecom.badlogic.gdx.ApplicationListener- Overrides:
resizein 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:
disposein interfacecom.badlogic.gdx.ApplicationListener- Overrides:
disposein classcom.badlogic.gdx.Game
-
-