-
Notifications
You must be signed in to change notification settings - Fork 7
Items
86LAK edited this page Aug 20, 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.
In the itemFactory.java a base item is shown below. With the default components added shown in green.
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.