Class Enemy

All Implemented Interfaces:
Collidable

@Group public abstract class Enemy extends Entity
This class is the parent class of all Enemies in the game.
  • Constructor Details

    • Enemy

      protected Enemy()
      Prototype Constructor.
    • Enemy

      protected Enemy(Vec startPos, Vec vel, Vec size)
      Create an Enemy.
      Parameters:
      startPos - the start pos
      vel - the start velocity
      size - the size
  • Method Details

    • getPrototypes

      public static final Set<? extends GameElement> getPrototypes()
      Load all Enemies.
      Returns:
      a set of enemies
      See Also:
    • create

      public abstract Enemy 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.

      Overrides:
      create in class GameElement
      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.