Skip to content
PHONGNGYUEN1 edited this page Aug 23, 2024 · 3 revisions

Usage

Apples are a subclass of the Food class. This item provides values for the quantity, limit, texture, name, and item code of this specific item. Apples has the least effect of improving hunger stats compared to the rest of the food items.

Expected Behaviour

The item should be able to increase the player's hunger stat by 2 and should be deleted from inventory after 5 uses

Creating item

public Apple(Texture foodTexture) {
        super("Apple", 5, 10, 5, new FeedEffect(2));
        this.appleTexture = new Texture("foodTexture/apple.png");
    }

Image of Apple

image from https://www.deviantart.com/luna4s/art/Pixelart-Apple-706000118

Clone this wiki locally