Tile colors can be overwritten

This commit is contained in:
Yohann D'ANELLO
2020-12-26 14:02:35 +01:00
parent 9a56b4d7e9
commit 6b7f8867fa
3 changed files with 20 additions and 5 deletions

View File

@ -19,8 +19,11 @@ class MapDisplay(Display):
def update_pad(self) -> None:
self.pad.resize(500, 500)
self.addstr(self.pad, 0, 0, self.map.draw_string(self.pack),
self.pack.tile_fg_color, self.pack.tile_bg_color)
for i in range(self.map.height):
for j in range(self.map.width):
self.addstr(self.pad, i, j * self.pack.tile_width,
self.map.tiles[i][j].char(self.pack),
*self.map.tiles[i][j].color(self.pack))
for e in self.map.entities:
self.addstr(self.pad, e.y, self.pack.tile_width * e.x,
self.pack[e.name.upper()],

View File

@ -91,7 +91,7 @@ TexturePack.SQUIRREL_PACK = TexturePack(
EMPTY=' ',
EXPLOSION='💥',
FLOOR='██',
LADDER='🪜',
LADDER=('🪜', curses.COLOR_WHITE, curses.COLOR_WHITE),
HAZELNUT='🌰',
HEART='💜',
HEDGEHOG='🦔',