This repository was archived by the owner on May 17, 2023. It is now read-only.
This repository was archived by the owner on May 17, 2023. It is now read-only.
Equipment and inventory #88
Open
Description
Once we have an in-game menu (#13) we'll be able to show an inventory and equipment GUI.
This can be pretty simple for now. On the data side:
- We'll have an
Item
protocol.- It will have an asset name which refers to the graphic that we'll use for this item when rendering the inventory.
- It will have an
ItemType
enum:Weapon
,Other
. We'll add more later on but this will be enough to get started.
- The inventory is an array of
Optional[Item]
objects with a fixed size (16), and each element starts off asNone
. - We'll have an
EquipmentSlot
class. It will have a mutableOptional[Item]
field, and an immutableSet[ItemType]
which is the set of item types that can be equipped in this slot. - The player will have an "equipped items" property which is a list of
EquipmentSlot
s. It will have one item for now, which is a weapon slot.
For the display:
- Render the inventory on the left as a 4x4 grid of buttons.
- Render the equipped items on the right as a single column.
- The player can drag an item from the inventory into the equipped item slot. If the item has the allowed type, we'll update that slot to use that item instead.
Note that this requires us to figure out how Arcade's drag and drop system works. If we can't figure that out, then instead allow the player to click on an equipment slot and then click on an item. If it's a valid item then equip it, and de-select the slot.
Metadata
Metadata
Assignees
Labels
No labels