Class OxygenEaterAttackPattern

All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable

public class OxygenEaterAttackPattern extends AttackPatternComponent
The OxygenEater attack pattern class defines the attack behaviour of an OxygenEater entity. It allows the OxygenEater to detect the player and attack them when in range.
  • Constructor Details

    • OxygenEaterAttackPattern

      public OxygenEaterAttackPattern(float attackFrequency, Supplier<Entity> projectileSupplier)
      Parameters:
      attackFrequency - How often the OxygenEater attacks.
      projectileSupplier - The projectile supplier for the OxygenEater's projectile.
  • Method Details

    • create

      public void create()
      Initialises the OxygenEaterAttackPattern component when it is created. This method sets up event listeners and interaction detection for the OxygenEater.
      Overrides:
      create in class AttackPatternComponent
    • attack

      protected void attack()
      Performs the attack action which involves detecting the player entity if one exists and shooting projectiles at them.
      Overrides:
      attack in class AttackPatternComponent