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 TypeMethodDescriptionvoidaddHealth(int health) Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.voiddamage(ColliderComponent collider) Sets whether a player is in interaction range of this button Adds the player to the "interact" event the first timevoidhit(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.voidsetHealth(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, getIsInvulnerable, getLastAttacker, setBaseAttack, setIsInvulnerable, setLastAttackerMethods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPrio, 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:
setHealthin 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:
addHealthin 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:
hitin classCombatStatsComponent- Parameters:
attacker- the attacker's CombatStatsComponent
-
isDead
Override CombatStatsComponent health-related functions to do nothing, as traps should not be able to be damaged or healed.- Overrides:
isDeadin 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)
-