Class TNTDamageComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.tower.TNTDamageComponent

public class TNTDamageComponent extends Component
Class responsible for applying damage and knock-back to nearby entities when triggered. Utilizes HitboxComponent and CombatStatsComponent for functionality.
  • Constructor Details

    • TNTDamageComponent

      public TNTDamageComponent(short targetLayer)
      Default constructor for creating a component without knockback.
      Parameters:
      targetLayer - The physics layer of the target entities' collider.
    • TNTDamageComponent

      public TNTDamageComponent(short targetLayer, float knockback, float radius)
      Overloaded constructor for creating a component with knockback and radius.
      Parameters:
      targetLayer - The physics layer of the target entities' collider.
      knockback - The force of the knockback.
      radius - The radius within which entities will be affected.
  • Method Details

    • create

      public void create()
      Initializes the component and registers event listeners.
      Overrides:
      create in class Component