Basic item and monster interface

This commit is contained in:
Nicolas Margulies
2020-10-23 16:51:48 +02:00
parent 7c1c427892
commit 343e107b86
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,15 @@
from ..interfaces import Entity
class Item(Entity):
held:bool
def __init__(self, *args, **kwargs):
super().__init__(self, *args, **kwargs)
self.held = False
def drop(self, x:int, y:int):
self.held = False
self.move(x, y)
def hold(self):
self.held = True