API Docs for:
Show:

AttackSystem Class

System reponsible for handling attacking. For an attack to trigger, a Position, a FacingDirection and an Attacking component are required. The triggering of attacks happens via the input and AI systems. The attack system will listen for 'attack' events from those. Beside that, the system will make use of spell effects. If an AttackEnchantSpellEffect is present on the SpellEffects component, the enchant will be triggered instead of the attack. If AttackSpeedSpellEffects are present, they're used during attack cooldown calculation. If an entity is grappling anything, checked via the WallGrappling component, the attack will be prevented. This system triggers animations. 'attackLeft' or 'attackRight' animations are played depending on the facing direction when an attack is performed. The animations will be sped up if an animation lasts longer than the attack cooldown.

Constructor

AttackSystem

(
  • entitySystemManager
  • inputSystem
  • aISystem
  • healthSystem
  • spellSystem
  • physicsSystem
  • forceGeneratorRegistry
  • collisionMasks
)

Parameters:

Item Index

Methods

Methods

destroy

()

update

(
  • deltaTime
)

Parameters:

  • deltaTime Number

    The time that passed since last update.