Make map display empty squares

This commit is contained in:
Joscha 2017-04-05 19:44:21 +00:00
parent f5166319e1
commit 7521d7b4ab
4 changed files with 153 additions and 11 deletions

View file

@ -1,23 +1,35 @@
import curses
import sys
import threading
from maps import Map
from chunks import ChunkPool
# import fron chunks, maps, clientchunkpool
class Client():
def __init__(self, address):
self.address = address
self.clock = threading.RLock()
#self.pool = Chunkpool()
self.pool = ChunkPool()
#self.map_ = Map(sizex, sizey, self.pool)
#self.chunkmap = Chunkmap(sizex, sizey, self.pool) # size changeable by +/-?
#self.sock = socket.Socket(...)
def launch(self):
# try to connect
# launch socket thread
# update display
# -> launch input thread
def launch(self, stdscr):
sizey, sizex = stdscr.getmaxyx()
self.map_ = Map(sizex, sizey, self.pool)
stdscr.noutrefresh()
self.map_.draw()
curses.doupdate()
stdscr.getkey()
self.map_.worldx += 1
self.map_.cursorx += 2
self.map_.cursory += 1
stdscr.noutrefresh()
self.map_.draw()
curses.doupdate()
stdscr.getkey()
def get_input(self, scr):
pass
@ -32,7 +44,7 @@ def main(argv):
return
client = Client(argv[1])
client.launch()
curses.wrapper(client.launch)
if __name__ == "__main__":
main(sys.argv)