Class DeathComponent

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

public class DeathComponent extends Component
When this entity (usually killable entities) has health = 0, it disposes the enemy form the field of play.
  • Constructor Details

    • DeathComponent

      public DeathComponent()
  • Method Details

    • create

      public void create()
      Creates a new listener on an entity to wait for kill condition
      Overrides:
      create in class Component
    • kill

      public void kill(com.badlogic.gdx.physics.box2d.Fixture me, com.badlogic.gdx.physics.box2d.Fixture other)
      When kill condition met, target entity will be disposed.
      Parameters:
      me - The current Entity's Fixture
      other - The targeted Entity's Fixture