Skip to content
PHONGNGYUEN1 edited this page Aug 21, 2024 · 2 revisions

Usage

Candy is a subclass of the Food class. This item provides values for the quantity, limit, texture, name, effect, and item code of this specific item. Unlike the other existing food items, candy has the highest affect with smallest quantity

Expected Behaviour

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

Creating item

 public Candy(Texture foodTexture) {
        super("Candy", 7, 10, 1, new FeedEffect(10));
        this.candyTexture = new Texture("foodTexture/candy.png");
    }

Image of Candy

image

Clone this wiki locally