Class BatAttackPattern
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.combat.attackpatterns.AttackPatternComponent
com.csse3200.game.components.combat.attackpatterns.BatAttackPattern
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable
The BatAttackPattern class defines the attack behavior of a Bat entity in the game.
It allows the bat 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
attack()
Performs the attack action, which involves determining the nearest entity, changing direction, triggering attack events, and scheduling the next attack.Methods inherited from class com.csse3200.game.components.combat.attackpatterns.AttackPatternComponent
create, startAttack
Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, read, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update, write
-
Constructor Details
-
BatAttackPattern
public BatAttackPattern(float attackFrequency)
-
-
Method Details
-
attack
protected void attack()Performs the attack action, which involves determining the nearest entity, changing direction, triggering attack events, and scheduling the next attack.- Overrides:
attack
in classAttackPatternComponent
-