java.lang.Object
com.csse3200.game.minigames.birdiedash.entities.Coin

public class Coin extends Object
Class for the coin in the birdie dash mini-game
  • 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