Package com.csse3200.game.components
Class EnterCombatComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.EnterCombatComponent
When this entity touches a valid enemy's hitbox, deal damage to them and apply a knockback.
Requires CombatStatsComponent, HitboxComponent on this entity.
Damage is only applied if target entity has a CombatStatsComponent. Knockback is only applied if target entity has a PhysicsComponent.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionEnterCombatComponent
(short targetLayer, GdxGame game) Create a component which attacks entities on collision, without knockback. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
EnterCombatComponent
Create a component which attacks entities on collision, without knockback.- Parameters:
targetLayer
- The physics layer of the target's collider.
-
-
Method Details