Class DamageParticle

All Implemented Interfaces:
Collidable

public abstract class DamageParticle extends Particle
Regular Particle with the only difference, that it damages the Player upon collision.
Author:
Angelo Aracri
  • Constructor Details

  • Method Details

    • reactToCollision

      public void reactToCollision(GameElement element, Direction dir)
      Description copied from interface: Collidable

      Notification that this GameElement has been collided with from another GameElement element from the given direction dir.

      Can be overwritten for defining an optional reaction that the GameElement performs on the other GameElement and/or itself upon collision.

      Specified by:
      reactToCollision in interface Collidable
      Overrides:
      reactToCollision in class GameElement
      Parameters:
      element - the GameElement that collided with this GameElement
      dir - the Direction this GameElement has been collided from.
    • create

      public abstract DamageParticle create()
      Description copied from class: Particle
      Create a particle.
      Overrides:
      create in class Particle
      Returns:
      a new particle
    • getFrame

      public Frame getFrame()
      Description copied from class: GameElement
      Returns a Frame that represents the collision box the GameElement will be using. Is dependent of the GameElements position and size.
      Overrides:
      getFrame in class GameElement
      Returns:
      the GameElements collision box