Class StrengthPot

java.lang.Object
entities.items.Item
entities.items.StrengthPot
All Implemented Interfaces:
Collectible

public class StrengthPot extends Item
A collectible strength potion item. When collected, it increases the player's attack power by a fixed amount.
  • Field Details

    • WIDTH

      private static final double WIDTH
      Width of the strength potion sprite.
      See Also:
    • HEIGHT

      private static final double HEIGHT
      Height of the strength potion sprite.
      See Also:
    • STRENGTH

      private static final int STRENGTH
      Amount of power restored when collected.
      See Also:
    • DMGUP_SPRITE

      private static final javafx.scene.image.Image DMGUP_SPRITE
      Sprite image for the strength potion.
  • Constructor Details

    • StrengthPot

      public StrengthPot(double x, double y)
      Constructs a new StrengthPot at the specified position.
      Parameters:
      x - X coordinate of the item center
      y - Y coordinate of the item center
  • Method Details

    • collect

      public void collect(Player player)
      Collects the item and increases the player's attack power.
      Specified by:
      collect in interface Collectible
      Specified by:
      collect in class Item
      Parameters:
      player - The player who collects the item
    • render

      public void render(javafx.scene.canvas.GraphicsContext gc)
      Renders the strength potion at its current position.
      Specified by:
      render in interface Collectible
      Specified by:
      render in class Item
      Parameters:
      gc - GraphicsContext used for rendering