Test clicking on the screen

This commit is contained in:
Yohann D'ANELLO
2020-12-11 18:33:47 +01:00
parent d9912cacad
commit f453b82a58
3 changed files with 31 additions and 3 deletions

View File

@ -28,7 +28,7 @@ class Item(Entity):
"""
if self.held:
self.held_by.inventory.remove(self)
self.map.add_entity(self)
self.held_by.map.add_entity(self)
self.move(self.held_by.y, self.held_by.x)
self.held = False
self.held_by = None
@ -49,7 +49,7 @@ class Item(Entity):
"""
self.held = True
self.held_by = player
self.map.remove_entity(self)
self.held_by.map.remove_entity(self)
player.inventory.append(self)
def save_state(self) -> dict: