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

Items

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

From the itemFactory.java image As seen above, all items have the above base components. To extend the functionality and create a hoe, refer to the below image image To add functionality to a tool or item in the game, just add the relevant Component to the entity.

Clone this wiki locally