Class TNTDamageComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.tower.TNTDamageComponent
Class responsible for applying damage and knock-back to nearby entities when triggered.
Utilizes HitboxComponent and CombatStatsComponent for functionality.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTNTDamageComponent
(short targetLayer) Default constructor for creating a component without knockback.TNTDamageComponent
(short targetLayer, float knockback, float radius) Overloaded constructor for creating a component with knockback and radius. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Initializes the component and registers event listeners.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
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