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

View File

@ -1,5 +1,9 @@
from ..interfaces import FightingEntity from ..interfaces import FightingEntity
class Squirrel(FightingEntity): class Monster(FightingEntity):
def behaviour(self, map):
pass
class Squirrel(Monster):
maxhealth = 10 maxhealth = 10
strength = 3 strength = 3