Class TrapComponent


public class TrapComponent extends CombatStatsComponent
  • Constructor Details

    • TrapComponent

      public TrapComponent(com.badlogic.gdx.math.Vector2 safeSpot, int rotation)
    • TrapComponent

      public TrapComponent(int health, int baseAttack, com.badlogic.gdx.math.Vector2 safeSpot, int rotation)
  • Method Details

    • setHealth

      public void setHealth(int health)
      Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.
      Overrides:
      setHealth in class CombatStatsComponent
      Parameters:
      health - health
    • addHealth

      public void addHealth(int health)
      Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.
      Overrides:
      addHealth in class CombatStatsComponent
      Parameters:
      health - health
    • hit

      public void hit(CombatStatsComponent attacker)
      Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.
      Overrides:
      hit in class CombatStatsComponent
    • isDead

      public Boolean isDead()
      Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.
      Overrides:
      isDead in class CombatStatsComponent
      Returns:
      is player dead
    • damage

      public void damage(ColliderComponent collider)
      Sets whether a player is in interaction range of this button Adds the player to the "interact" event the first time
      Parameters:
      collider - Player's ColliderComponent (null if player leaves collision range)