All Implemented Interfaces:
Collidable

@LoadMe public final class Life extends Pickup
This class defines a simple Pickup; a Life which will give the player lives.
  • Constructor Details

    • Life

      public Life()
      Prototype Constructor.
    • Life

      public Life(Vec startPos)
      Instantiate a Life by start position.
      Parameters:
      startPos - the start position
  • Method Details

    • perform

      public void perform(GameElement collector)
      Description copied from class: Pickup
      Template method that should be overwritten in concrete Pickups to add the action that is performed upon being collected by the Player.
      Specified by:
      perform in class Pickup
      Parameters:
      collector - the GameElement which collects this Pickup
    • internalRender

      public void internalRender(GameGrid f)
      Description copied from class: GameElement

      Template method that will be called periodically after being added to a IScene. Must be as performant as possible to keep the FPS low, since it will be called in every render-loop.

      Should be overwritten in sub classes for custom visualization using the GameGrid.

      Overrides:
      internalRender in class GameElement
      Parameters:
      f - the GameGrid that represents the games field and supplies primitive drawing operations.
    • create

      public Life 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 Pickup
      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.