Receiving a TypeError when trying to run:
File "/home/XX/PycharmProjects/rogue_like/venv/lib64/python3.7/site-packages/tcod/libtcodpy.py", line 1236, in console_put_char
lib.TCOD_console_put_char(_console(con), x, y, _int(c), flag)
TypeError: an integer is required
Class Object:
def __init__(self, x, y, char, color):
self.x = x
self.y = y
self.char = char
self.color = color
def draw(self):
libtcod.console_set_default_foreground(con, self.color)
libtcod.console_put_char(con, self.x, self.y, self.char, libtcod.BKGND_NONE)
# later...
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50
player = Object(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, '@', libtcod.yellow)
Following a roguelike tutorial and ran into this. Have tried passing an integer by changing the '@' to a number and other things. Have tried handing it to int(self.char)
and other options but seem to be hitting a wall.
Any help would be great! Tried to include pertinent code, let me know if there's anything else.
EDIT:
"""
...
Args:
con (Console): Any Console instance.
x (int): Character x position from the left.
y (int): Character y position from the top.
c (Union[int, AnyStr]): Character to draw, can be an integer or string.
flag (int): Blending mode to use, defaults to BKGND_DEFAULT.
"""
lib.TCOD_console_put_char(_console(con), x, y, _int(c), flag)