Monsters are hedgehogs 🦔
This commit is contained in:
@ -17,7 +17,7 @@ class MapDisplay(Display):
|
||||
def update_pad(self) -> None:
|
||||
self.pad.addstr(0, 0, self.map.draw_string(self.pack))
|
||||
for e in self.map.entities:
|
||||
self.pad.addstr(e.y, e.x, self.pack.PLAYER)
|
||||
self.pad.addstr(e.y, e.x, self.pack[e.name.upper()])
|
||||
|
||||
def display(self) -> None:
|
||||
y, x = self.map.currenty, self.map.currentx
|
||||
|
@ -15,6 +15,9 @@ class TexturePack:
|
||||
self.__dict__.update(**kwargs)
|
||||
TexturePack._packs[name] = self
|
||||
|
||||
def __getitem__(self, item):
|
||||
return self.__dict__[item]
|
||||
|
||||
@classmethod
|
||||
def get_pack(cls, name: str) -> "TexturePack":
|
||||
return cls._packs[name.lower()]
|
||||
@ -26,6 +29,7 @@ TexturePack.ASCII_PACK = TexturePack(
|
||||
WALL='#',
|
||||
FLOOR='.',
|
||||
PLAYER='@',
|
||||
HEDGEHOG='*',
|
||||
)
|
||||
|
||||
TexturePack.SQUIRREL_PACK = TexturePack(
|
||||
@ -34,4 +38,5 @@ TexturePack.SQUIRREL_PACK = TexturePack(
|
||||
WALL='█',
|
||||
FLOOR='.',
|
||||
PLAYER='🐿️',
|
||||
HEDGEHOG='🦔',
|
||||
)
|
||||
|
Reference in New Issue
Block a user