Package com.csse3200.game.components
Class SplitFireworksComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.SplitFireworksComponent
A component that splits the projectile into multiple mini projectiles.
Assumes projectile has a disposesOnHit functionality.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSplitFireworksComponent
(short targetLayer, int amount) Initialises a component that splits the projectile into multiple fireballs upon collision on a specified target layer. -
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
-
SplitFireworksComponent
public SplitFireworksComponent(short targetLayer, int amount) Initialises a component that splits the projectile into multiple fireballs upon collision on a specified target layer. The spawned projectiles will be spawned just before original projectile and spread out in multiple direction set by a certain range. Assumes amount of split projectiles is greater or equal than 2.- Parameters:
targetLayer
- Target layer upon collision.amount
- Amount of projectiles that is split after collision event.
-
-
Method Details