Class SelfDestructComponent

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

public class SelfDestructComponent extends Component
Handles logic for a drone that self-destructs within collision radius of player.
  • Constructor Details

    • SelfDestructComponent

      public SelfDestructComponent(Entity target)
      Constructor takes the entity to target (usually the player).
  • Method Details

    • create

      public void create()
      Called when the component is created. Sets up event listeners for handling cleanup after explosion.
      Overrides:
      create in class Component
    • update

      public void update()
      Description copied from class: Component
      Called once per frame of the game, and should be used for most component logic. Not called if component is disabled.
      Overrides:
      update in class Component