Skip to content
86LAK edited this page Aug 20, 2023 · 15 revisions

Items (DRAFT)

Overview

The ItemFactory is a crucial part of the Entity-Component-System (ECS) architecture within our game. It represents the properties and behaviour of an in-game item. Items can be anything from weapons, tools, plants, to any other interactable objects that players can use or manipulate.

To make items using the ECS approach, components are added to the entity. This modular approach allows shorter and less complicated code.

How to create your own custom items

HOE

In the itemFactory.java a base item is shown below. With the default components added shown in green. image

To extend this base item into a hoe, we need to add the relevant components to this Entity to make it a hoe. For example a hoe would have the following added components.

image

Clone this wiki locally