diff --git a/docs/items.md b/docs/items.md index 783a97e..a2d79c9 100644 --- a/docs/items.md +++ b/docs/items.md @@ -32,7 +32,14 @@ code_file: "[string]" Pocket is a list of items that are "collected" by the user. This can be used to record what the user has seen, or to retain items which may be useful for the user to progress in the game. Pocket items can be [reinteracted](#interaction) with. Items can be marked as collectable in the [`.item` file](#.item-files) or can be added manually via [code file](#item-coding). -The game always starts with no items in the `Pocket`. +The game always initializes with no items in the `Pocket`. + +The function + +```py +Pocket.append(itemname, game) +Pocket.remove(itemname, game) +``` ## Interaction diff --git a/tetra/items.py b/tetra/items.py index e35e269..a98894e 100644 --- a/tetra/items.py +++ b/tetra/items.py @@ -172,8 +172,8 @@ def show_desc(self, win, name): [win[f"desc_{i.name}"].update(visible = False) for i in self.itemlist] win[f"desc_{name}"].update(visible = True) - def append(self, item): - self.itemlist.append(item) + def append(self, itemname, game): + self.itemlist.append(game.item(itemname)) - def drop(self, item): - self.remove(item) + def drop(self, itemname, game): + self.itemlist.remove(game.item(itemname))