Class SplitFireworksComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.SplitFireworksComponent

public class SplitFireworksComponent extends Component
A component that splits the projectile into multiple mini projectiles. Assumes projectile has a disposesOnHit functionality.
  • 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

    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class Component