You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2023. It is now read-only.
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 as None.
We'll have an EquipmentSlot class. It will have a mutable Optional[Item] field, and an immutable Set[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 EquipmentSlots. 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.
The text was updated successfully, but these errors were encountered:
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:
Item
protocol.ItemType
enum:Weapon
,Other
. We'll add more later on but this will be enough to get started.Optional[Item]
objects with a fixed size (16), and each element starts off asNone
.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.EquipmentSlot
s. It will have one item for now, which is a weapon slot.For the display:
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.
The text was updated successfully, but these errors were encountered: