Class StrengthPot
java.lang.Object
entities.items.Item
entities.items.StrengthPot
- All Implemented Interfaces:
Collectible
A collectible strength potion item.
When collected, it increases the player's attack power by a fixed amount.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final javafx.scene.image.ImageSprite image for the strength potion.private static final doubleHeight of the strength potion sprite.private static final intAmount of power restored when collected.private static final doubleWidth of the strength potion sprite. -
Constructor Summary
ConstructorsConstructorDescriptionStrengthPot(double x, double y) Constructs a new StrengthPot at the specified position. -
Method Summary
-
Field Details
-
WIDTH
private static final double WIDTHWidth of the strength potion sprite.- See Also:
-
HEIGHT
private static final double HEIGHTHeight of the strength potion sprite.- See Also:
-
STRENGTH
private static final int STRENGTHAmount of power restored when collected.- See Also:
-
DMGUP_SPRITE
private static final javafx.scene.image.Image DMGUP_SPRITESprite 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 centery- Y coordinate of the item center
-
-
Method Details
-
collect
Collects the item and increases the player's attack power.- Specified by:
collectin interfaceCollectible- Specified by:
collectin classItem- 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:
renderin interfaceCollectible- Specified by:
renderin classItem- Parameters:
gc- GraphicsContext used for rendering
-