-
Notifications
You must be signed in to change notification settings - Fork 7
Items
86LAK edited this page Aug 17, 2023
·
15 revisions
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.
From the itemFactory.java As seen above, all items have the above base components. To extend the functionality and create a hoe, refer to the below image To add functionality to a tool or item in the game, just add the relevant Component to the entity.