Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Equipment and inventory #88

Open
robbrit opened this issue Apr 17, 2023 · 1 comment · May be fixed by #167
Open

Equipment and inventory #88

robbrit opened this issue Apr 17, 2023 · 1 comment · May be fixed by #167
Assignees

Comments

@robbrit
Copy link
Owner

robbrit commented Apr 17, 2023

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.

@robbrit robbrit mentioned this issue Apr 20, 2023
@Exkywor Exkywor self-assigned this Apr 29, 2023
@Exkywor
Copy link
Collaborator

Exkywor commented Apr 29, 2023

I'll start tackling this one next week.

@robbrit robbrit mentioned this issue May 2, 2023
@Exkywor Exkywor linked a pull request May 14, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants