public class Game
extends com.badlogic.gdx.ApplicationAdapter
Modifier and Type | Field and Description |
---|---|
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
assignRoboticonButton |
private com.badlogic.gdx.graphics.g2d.SpriteBatch |
batch |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
buyRoboticonButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
cancelSpecButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
energyAddBuyButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
energyAddSellButton |
private int |
energyBuyAmount |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
energyBuyButton |
private com.badlogic.gdx.scenes.scene2d.ui.Label |
energyLabel |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
energyMinusBuyButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
energyMinusSellButton |
private int |
energySellAmount |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
energySellButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
energySpecButton |
private com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator |
font |
private GameEngine |
gameEngine |
private com.badlogic.gdx.scenes.scene2d.Stage |
gameStage |
private com.badlogic.gdx.graphics.Texture |
mapImg |
private com.badlogic.gdx.scenes.scene2d.ui.Label |
marketStockLabel |
private com.badlogic.gdx.scenes.scene2d.ui.Label |
moneyLabel |
private com.badlogic.gdx.scenes.scene2d.ui.Label |
nameLabel |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
nextPhaseButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
oreAddBuyButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
oreAddSellButton |
private int |
oreBuyAmount |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
oreBuyButton |
private com.badlogic.gdx.scenes.scene2d.ui.Label |
oreLabel |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
oreMinusBuyButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
oreMinusSellButton |
private int |
oreSellAmount |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
oreSellButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
oreSpecButton |
private com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter |
parameter |
private com.badlogic.gdx.graphics.Texture |
roboticonImg |
private com.badlogic.gdx.graphics.glutils.ShapeRenderer |
shapeRenderer |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton |
specialiseRoboticonButton |
private com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle |
tbs |
private com.badlogic.gdx.scenes.scene2d.ui.Label |
timeLabel |
Constructor and Description |
---|
Game() |
Modifier and Type | Method and Description |
---|---|
void |
create() |
void |
dispose() |
void |
initAssests()
Initialises all of the assets required for the game to qork
|
void |
initGameUI()
Initialises the UI for the game
|
void |
initGameUIElements()
Initialises The different phases of the UI
|
void |
initMap()
this initialises the map so that it appears correctly and is able to take user mouse input
|
void |
initNextPhaseButton()
Initialises the next phase button so that is appears in the right place and performs the correct action
|
void |
initPhaseThreeUI()
Initialises the phase 3 UI so that the different elements appear in the correct place and the buttons perform the correct function.
|
void |
initPhaseTwoUI()
Initialises the phase 2 UI so that the different elements appear in the correct place and the buttons perform the correct function.
|
void |
initPlayerStatsUI()
Initialises the player stats so that they appear in the correct place and at the correct size
|
boolean |
onMapTouchDown(float screenX,
float screenY,
int button)
the function that is performed when the player clicks on the map
|
void |
onNextPhaseClick()
The functions that is performed when the player clicks on the nextPhaseButton
|
void |
render() |
void |
renderActiveTileHighlight()
renders the highlight for the current active tile so the player knows which tile they have selected
|
void |
renderMap()
draws the map to the screen
|
void |
renderRoboticons()
renders all of the roboticons to the screen
|
void |
renderTileHighlights()
draws the tile highlights to the screen so the players knows which tiles are owned buy which player
|
void |
renderUI()
renders the UI to the screen correctly
|
void |
roboticonSpecialiseMenu(com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle tbs)
The code to setup the specialise menu so that it is displayed correctly, this is called when the player clicks on the specialise roboticon button
|
private com.badlogic.gdx.graphics.g2d.SpriteBatch batch
private com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer
private com.badlogic.gdx.graphics.Texture mapImg
private com.badlogic.gdx.graphics.Texture roboticonImg
private com.badlogic.gdx.scenes.scene2d.Stage gameStage
private com.badlogic.gdx.scenes.scene2d.ui.Label timeLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label nameLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label oreLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label energyLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label moneyLabel
private com.badlogic.gdx.scenes.scene2d.ui.Label marketStockLabel
private com.badlogic.gdx.scenes.scene2d.ui.TextButton nextPhaseButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton buyRoboticonButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton specialiseRoboticonButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton assignRoboticonButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton oreSpecButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton energySpecButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton cancelSpecButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton oreAddSellButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton oreMinusSellButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton oreAddBuyButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton oreMinusBuyButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton energyAddSellButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton energyMinusSellButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton energyAddBuyButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton energyMinusBuyButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton energyBuyButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton energySellButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton oreBuyButton
private com.badlogic.gdx.scenes.scene2d.ui.TextButton oreSellButton
private int oreBuyAmount
private int oreSellAmount
private int energyBuyAmount
private int energySellAmount
private com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle tbs
private GameEngine gameEngine
private com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator font
private com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter parameter
public void create()
create
in interface com.badlogic.gdx.ApplicationListener
create
in class com.badlogic.gdx.ApplicationAdapter
public void initAssests()
public void initGameUI()
public void initGameUIElements()
public void initNextPhaseButton()
public void initPlayerStatsUI()
public void initPhaseTwoUI()
public void initPhaseThreeUI()
public void roboticonSpecialiseMenu(com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle tbs)
tbs
- the Text Buttons Style, so that the buttons appear to look like the other buttons so that they fit in with the rest of the UIpublic void onNextPhaseClick()
public void initMap()
public boolean onMapTouchDown(float screenX, float screenY, int button)
screenX
- The x location in pixels of where they clickedscreenY
- The y location in pixels of where they clickedbutton
- What button they click the mouse with, i.e left mouse buttonpublic void renderMap()
public void renderTileHighlights()
public void renderActiveTileHighlight()
public void renderRoboticons()
public void renderUI()
public void render()
render
in interface com.badlogic.gdx.ApplicationListener
render
in class com.badlogic.gdx.ApplicationAdapter
public void dispose()
dispose
in interface com.badlogic.gdx.ApplicationListener
dispose
in class com.badlogic.gdx.ApplicationAdapter