Draw a PLAYER and NPC @; make the NPC yellow

This commit is contained in:
Eryn Wells 2022-04-27 08:19:56 -07:00
parent 638f2d8826
commit 4419eb360d
2 changed files with 11 additions and 5 deletions

View file

@ -8,10 +8,11 @@ class Object:
A drawable object with a symbol and (x, y) position.
'''
def __init__(self, symbol, x=0, y=0):
def __init__(self, symbol, color=(255, 255, 255), x=0, y=0):
self.__x = int(x)
self.__y = int(y)
self.symbol = symbol
self.__color = color
self.__symbol = symbol
@property
def x(self):
@ -30,4 +31,4 @@ class Object:
self.__y = int(value)
def print(self, console: tcod.Console) -> None:
console.print(x=self.__x, y=self.__y, string=self.symbol)
console.print(x=self.__x, y=self.__y, string=self.__symbol, fg=self.__color)