Class Coin
java.lang.Object
com.csse3200.game.minigames.birdiedash.entities.Coin
Class for the coin in the birdie dash mini-game
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
changePosition
(float dt) Changed the coins position (as the screen moves)com.badlogic.gdx.math.Rectangle
get the coin boundaryfloat
returns the coins heightcom.badlogic.gdx.math.Vector2
Get the coins positionfloat
getWidth()
returns the coins widthvoid
spawns new coinvoid
setPosition
(float x, float y) Used for testing
-
Constructor Details
-
Coin
public Coin(float start, float speed) Constructors to create a coin. Coin will spawn randomly between pipes, both horizontally and vertically.
-
-
Method Details
-
getPosition
public com.badlogic.gdx.math.Vector2 getPosition()Get the coins position- Returns:
- the coins position
-
getWidth
public float getWidth()returns the coins width- Returns:
- the coins width
-
getHeight
public float getHeight()returns the coins height- Returns:
- the coins height
-
changePosition
public void changePosition(float dt) Changed the coins position (as the screen moves)- Parameters:
dt
- the time since the last update
-
respawnCoin
public void respawnCoin()spawns new coin -
getBoundary
public com.badlogic.gdx.math.Rectangle getBoundary()get the coin boundary- Returns:
- the coin boundary
-
setPosition
public void setPosition(float x, float y) Used for testing
-