Class ContinuousAttackComponent

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.npc.ContinuousAttackComponent

public class ContinuousAttackComponent extends Component
Continuous attack component - melee enemies will attack non-enemy attackable objects periodically while colliding with them
  • Constructor Details

    • ContinuousAttackComponent

      public ContinuousAttackComponent(long delay, long period)
      continuousAttackComponent
      Parameters:
      delay - the delay before attacking starts
      period - the period between consecutive attacks
  • Method Details

    • create

      public void create()
      creates the component, registering entity collision listeners starts looping through the list of colliders
      Overrides:
      create in class Component
    • getTimer

      public Timer getTimer()
      this is just for testing! Do not use!
      Returns:
      timer for this task