Display inventory content in statdisplay

This commit is contained in:
Yohann D'ANELLO
2020-11-11 23:41:06 +01:00
parent 12c653fe15
commit 21e85078a4
3 changed files with 16 additions and 5 deletions

View File

@ -13,8 +13,10 @@ class Item(Entity):
self.held = False
def drop(self, y: int, x: int) -> None:
self.held = False
self.held_by = None
if self.held:
self.held_by.inventory.remove(self)
self.held = False
self.held_by = None
self.map.add_entity(self)
self.move(y, x)

View File

@ -15,9 +15,13 @@ class Player(FightingEntity):
level: int = 1
current_xp: int = 0
max_xp: int = 10
inventory: list = list()
inventory: list
paths: Dict[Tuple[int, int], Tuple[int, int]]
def __init__(self):
super().__init__()
self.inventory = list()
def move(self, y: int, x: int) -> None:
"""
When the player moves, move the camera of the map.