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 The constructor for ItemComponent is below (note 3 different constructors) image

To add functionality to the item, go to the itemFactory.java and add the relevant component. if the component does not exist you will need to create your own.

Clone this wiki locally