public class Ghost extends Entity
Ghost enemy.
  • Constructor Details

    • Ghost

      public Ghost(GamePanel gamePanel, int xPosition)
      Creates a Ghost instance passing the GamePanel reference and initial position of the entity.
      Parameters:
      gamePanel - reference.
      xPosition - initial position.
  • Method Details

    • uniqueMovement

      protected void uniqueMovement()
      Ghosts have a slight vertical movement so that it looks like they are "floating".
      Overrides:
      uniqueMovement in class Entity
    • updateSprites

      protected void updateSprites()
      Activates "invisible" sprite every other 60 frames.
      NOTE: this is just a visual feature, hitbox and damage are still active.
      Overrides:
      updateSprites in class Entity