All Implemented Interfaces:
Saveable<BouncerMemento>, Enemies

public class Bouncer extends Enemy implements Saveable<BouncerMemento>
Bouncer enemy with multiple lives that intelligently chases the player.
  • Constructor Details

    • Bouncer

      public Bouncer(com.badlogic.gdx.math.Vector2 startPos)
  • Method Details

    • updateBehavior

      public void updateBehavior(float deltaTime, com.badlogic.gdx.math.Vector2 playerPosition, GameField gameField, Player player)
      Description copied from class: Enemy
      Updates enemy behavior including chasing and idle states.
      Overrides:
      updateBehavior in class Enemy
      Parameters:
      deltaTime - Time since last update
      playerPosition - Player's current position
      gameField - Game field for navigation
      player - Player reference
    • animate

      public void animate(com.badlogic.gdx.graphics.g2d.Batch batch)
      Description copied from class: GameObject
      Renders the object using its drawable or texture.
      Overrides:
      animate in class Enemy
      Parameters:
      batch - Sprite batch for rendering
    • AnimationDirection

      public void AnimationDirection()
      Description copied from interface: Enemies
      Updates enemy animation based on movement direction.
      Specified by:
      AnimationDirection in interface Enemies
    • takeDamage

      public boolean takeDamage(com.badlogic.gdx.math.Vector2 playerPos)
      Handles damage and fleeing behavior.
      Parameters:
      playerPos - Player position for flee direction
      Returns:
      True if enemy died, false if survived
    • flee

      public void flee()
      Description copied from interface: Enemies
      Makes the enemy flee in a random direction.
      Specified by:
      flee in interface Enemies
    • patrol

      public void patrol(float delta)
      Description copied from interface: Enemies
      Makes the enemy patrol around its area.
      Specified by:
      patrol in interface Enemies
      Parameters:
      delta - Time since last update
    • chase

      public void chase(float deltaTime, com.badlogic.gdx.math.Vector2 playerPosition, GameField gameField)
      Description copied from interface: Enemies
      Makes the enemy chase the player.
      Specified by:
      chase in interface Enemies
      Parameters:
      deltaTime - Time since last update
      playerPosition - Player's position
      gameField - Game field for navigation
    • getMemento

      public BouncerMemento getMemento()
      Description copied from interface: Saveable
      Creates a memento capturing the current state of this object.
      Specified by:
      getMemento in interface Saveable<BouncerMemento>
      Returns:
      A memento containing the object's state
    • loadFromMemento

      public void loadFromMemento(BouncerMemento memento)
      Description copied from interface: Saveable
      Restores the object's state from a memento.
      Specified by:
      loadFromMemento in interface Saveable<BouncerMemento>
      Parameters:
      memento - The memento containing the state to restore