All Implemented Interfaces:
Saveable<JunkieMemento>, Enemies

public class Junkie extends Enemy implements Saveable<JunkieMemento>
Junkie enemy that randomly moves and occasionally attacks nearby players.
  • Constructor Details

    • Junkie

      public Junkie(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
    • 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
    • AnimationDirection

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

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

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