Picking up things
The last month I have been working on an inventory and equipment system. In the video below the result so far can be seen. When the player walks into a sword, they pick it up and it is added to their equipment, if the correct equipment slot is still free. Otherwise, it is added to the inventory. All of this is implemented using a set of new components and systems. One component can mark an entity as an ‘item’, so it can be picked up by entities who have an ‘inventory’ or an ‘equipment’ component.
Graphically, this involves sets of coordinates to define the relative location of a carried item during an animation, defining both the equipment slots in the equipper’s animation frames, as well as the location of the ‘handle’ in the item frames. By pressing keys i or e the player can view inventory and equipment menus. In the future these will allow the player to manage their items.
The plan is for there to be a floor menu as well. Picking up random things by running into them can be undesired in the midst of battle, so this is perhaps better handled in a menu showing what items are on the floor nearby. It is yet to be discovered to what extend browsing through menus and pressing the right keys is acceptable during battle. 😉