Add possibility to define the background color of entities (black in ASCII, white in Unicode)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import curses
|
||||
from typing import Any
|
||||
|
||||
|
||||
@@ -6,6 +7,10 @@ class TexturePack:
|
||||
|
||||
name: str
|
||||
tile_width: int
|
||||
tile_fg_color: int
|
||||
tile_bg_color: int
|
||||
entity_fg_color: int
|
||||
entity_bg_color: int
|
||||
EMPTY: str
|
||||
WALL: str
|
||||
FLOOR: str
|
||||
@@ -19,7 +24,7 @@ class TexturePack:
|
||||
self.__dict__.update(**kwargs)
|
||||
TexturePack._packs[name] = self
|
||||
|
||||
def __getitem__(self, item) -> Any:
|
||||
def __getitem__(self, item: str) -> Any:
|
||||
return self.__dict__[item]
|
||||
|
||||
@classmethod
|
||||
@@ -30,6 +35,10 @@ class TexturePack:
|
||||
TexturePack.ASCII_PACK = TexturePack(
|
||||
name="ascii",
|
||||
tile_width=1,
|
||||
tile_fg_color=curses.COLOR_WHITE,
|
||||
tile_bg_color=curses.COLOR_BLACK,
|
||||
entity_fg_color=curses.COLOR_WHITE,
|
||||
entity_bg_color=curses.COLOR_BLACK,
|
||||
EMPTY=' ',
|
||||
WALL='#',
|
||||
FLOOR='.',
|
||||
@@ -40,9 +49,13 @@ TexturePack.ASCII_PACK = TexturePack(
|
||||
TexturePack.SQUIRREL_PACK = TexturePack(
|
||||
name="squirrel",
|
||||
tile_width=2,
|
||||
tile_fg_color=curses.COLOR_WHITE,
|
||||
tile_bg_color=curses.COLOR_BLACK,
|
||||
entity_fg_color=curses.COLOR_WHITE,
|
||||
entity_bg_color=curses.COLOR_WHITE,
|
||||
EMPTY=' ',
|
||||
WALL='██',
|
||||
FLOOR='..',
|
||||
PLAYER='🐿️',
|
||||
WALL='🟫',
|
||||
FLOOR='██',
|
||||
PLAYER='🐿 ️',
|
||||
HEDGEHOG='🦔',
|
||||
)
|
||||
|
Reference in New Issue
Block a user