All Implemented Interfaces:
Saveable<TouristMemento>, Enemies

public class Tourist extends Enemy implements Saveable<TouristMemento>
Tourist enemy that dances idly and flees when startled by kills.
  • Constructor Details

    • Tourist

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

    • scaredTourists

      public static boolean scaredTourists(GameField gameField, com.badlogic.gdx.math.Vector2 deathPosition)
      Scares all tourists near a death position.
      Parameters:
      gameField - Game field to find tourists
      deathPosition - Position of death
      Returns:
      True if any tourists were scared
    • 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
    • AnimationDirection

      public void AnimationDirection()
      Description copied from interface: Enemies
      Updates enemy animation based on movement direction.
      Specified by:
      AnimationDirection in interface Enemies
    • 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 deltaTime)
      Description copied from interface: Enemies
      Makes the enemy patrol around its area.
      Specified by:
      patrol in interface Enemies
      Parameters:
      deltaTime - 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 TouristMemento getMemento()
      Description copied from interface: Saveable
      Creates a memento capturing the current state of this object.
      Specified by:
      getMemento in interface Saveable<TouristMemento>
      Returns:
      A memento containing the object's state
    • loadFromMemento

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