Class DefaultCoin

All Implemented Interfaces:
Collidable

@LoadMe public class DefaultCoin extends Coin
This class represents default coins.
  • Constructor Details

    • DefaultCoin

      public DefaultCoin()
      Prototype constructor.
    • DefaultCoin

      protected DefaultCoin(Vec startPos)
      Constructor with position.
      Parameters:
      startPos - the position.
  • Method Details

    • getColor

      protected RGBAColor getColor()
      Description copied from class: Coin
      Get the main color of the coin.
      Specified by:
      getColor in class Coin
      Returns:
      the main color
    • getDarkerColor

      protected RGBAColor getDarkerColor()
      Description copied from class: Coin
      Get a darker version of the color Coin.getColor() for the edge of the coin.
      Specified by:
      getDarkerColor in class Coin
      Returns:
      the darker color
    • getValue

      protected int getValue()
      Description copied from class: Coin
      Get the value of the coin.
      Specified by:
      getValue in class Coin
      Returns:
      the value
    • create

      public DefaultCoin create(Vec startPos, String... options)
      Description copied from class: GameElement

      Stub Factory method that every GameElement must implement in order to being able to be instantiated dynamically by the level creation.

      A startPos must be supplied to position the new GameElement right.

      Also, an array of modifiers that the extending GameElement can define and use is supplied. These are used make level creation able to determine the GameElements behavior. Note: the modifiers are not checked in syntax, so it must be thoroughly checked.

      Specified by:
      create in class Coin
      Parameters:
      startPos - the initial position of the new GameElement.
      options - optional parameters that may determine additional behavior of the GameElement.
      Returns:
      the newly created GameElement.