Class TrapComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.CombatStatsComponent
com.csse3200.game.components.obstacles.TrapComponent
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionTrapComponent
(int health, int baseAttack, com.badlogic.gdx.math.Vector2 safeSpot, int rotation) TrapComponent
(com.badlogic.gdx.math.Vector2 safeSpot, int rotation) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addHealth
(int health) Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.void
damage
(ColliderComponent collider) Sets whether a player is in interaction range of this button Adds the player to the "interact" event the first timevoid
hit
(CombatStatsComponent attacker) Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.isDead()
Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.void
setHealth
(int health) Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.Methods inherited from class com.csse3200.game.components.CombatStatsComponent
getBaseAttack, getHealth, setBaseAttack
Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
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 classCombatStatsComponent
- 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 classCombatStatsComponent
- Parameters:
health
- health
-
hit
Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.- Overrides:
hit
in classCombatStatsComponent
-
isDead
Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.- Overrides:
isDead
in classCombatStatsComponent
- Returns:
- is player dead
-
damage
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)
-