Class OxygenEaterAttackPattern
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.combat.attackpatterns.AttackPatternComponent
com.csse3200.game.components.combat.attackpatterns.OxygenEaterAttackPattern
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable
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.
-
Field Summary
Fields inherited from class com.csse3200.game.components.combat.attackpatterns.AttackPatternComponent
attackFrequency, currentAttackEvent, interactionDetector
-
Constructor Summary
ConstructorsConstructorDescriptionOxygenEaterAttackPattern
(float attackFrequency, Supplier<Entity> projectileSupplier) -
Method Summary
Methods inherited from class com.csse3200.game.components.combat.attackpatterns.AttackPatternComponent
startAttack
Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, read, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update, write
-
Constructor Details
-
OxygenEaterAttackPattern
- 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 classAttackPatternComponent
-
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 classAttackPatternComponent
-