Class Boss

All Implemented Interfaces:
Collidable

@Group public abstract class Boss extends Entity
This class shall be extended in case of creating Bosses.
  • Field Details

    • bossStructure

      protected BossStructure bossStructure
      The Bosses Level-Structure (BossRoom).
    • target

      protected GameElement target
      The target of the Boss.
    • isHarmless

      protected boolean isHarmless
      This boolean indicates whether the boss is harmless.
  • Constructor Details

    • Boss

      protected Boss()
      Create a Boss.
    • Boss

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

    • getPrototypes

      public static final Set<? extends GameElement> getPrototypes()
      Get all instances of BossPrototypes.
      Returns:
      a set of BossPrototypes
      See Also:
    • innerLogicLoop

      protected void innerLogicLoop()
      Description copied from class: Entity
      This method will calculate the next position of the Entity depending on the velocity.
      Overrides:
      innerLogicLoop in class Entity
    • getName

      public abstract String getName()
      Get the BossName.
      Returns:
      the bossName
    • setBossStructure

      public final void setBossStructure(BossStructure bossStructure)
      Set the bossroom-structure.
      Parameters:
      bossStructure - the bossroom-structure
    • setTarget

      public final void setTarget(GameElement target)
      Set the target of the boss.
      Parameters:
      target - the target
    • getBossStructure

      public BossStructure getBossStructure()
      Get and set the boss structure.
      Returns:
      the boss-structure
    • getStartPos

      public Vec getStartPos()
      Get initial position of the Boss relative to the BossStructures top left corner.
      Returns:
      the relative start position of the Boss.
    • create

      public abstract Boss 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.
    • destroy

      public final void destroy()
      Description copied from class: GameElement

      Method that, upon call, signals that this GameElement is supposed to be deleted in the next logicLoop of the IScene.

      Note: The underlying GameElement might go through several collisions and be rendered multiple times before it is actually deleted.

      Overrides:
      destroy in class GameElement
    • getZHint

      public Integer getZHint()
      Description copied from class: GameElement
      Get a hint (for Team.Range.normalize(int) for positioning this GameElement via GameElement.getZ().
      Overrides:
      getZHint in class GameElement
      Returns:
      null if no hint, otherwise the expected position