Package com.csse3200.game.components
Class SelfDestructOnHitComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.SelfDestructOnHitComponent
This specific entity will self-destruct after the collisionEnd
event if the targetLayer matches.
Possible extensions to take in an array of entities instead.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSelfDestructOnHitComponent
(short targetLayer) Create a component that self-destructs based on a specified targetLayer. -
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
-
SelfDestructOnHitComponent
public SelfDestructOnHitComponent(short targetLayer) Create a component that self-destructs based on a specified targetLayer.- Parameters:
targetLayer
- Physic's layer of the target collider.
-
-
Method Details