I'm trying to make a game in python with a nethack-style map, I'm using the curses module to organize my screen.
I have a class in a module (characters.py) called "Character", which will control npc movement. How can I make it so, when an npc moves or is created, the curses window mapwin in the main file (main.py) updates?
Something like (in the Characters class)
Code:
def __init__(self,y,x):
self.y=y#track character's
self.x=x#y and x location
main.mapwin.addstr(self.y,self.x,"Q")
#when created, place new character on
#map with the symbol "Q"
main.mapwin.refresh()
I can't figure out how to access the curses windows from an external class. Is it even possible?