import curses key_left = ['h', 'a'] key_right = ['l', 'd'] key_down = ['j', 's'] key_up = ['k', 'w'] maxX = 4 maxY = 4 gamestate = [[0 for mx in range(maxX)] for my in range(maxY)] gamestate[2][2] = 1 gamestate[1][2] = 1 gamestate[3][2] = 1 def DrawSquare(x, y, val): stdscr.addstr(y, x, "+") def FullDraw(): for i in range(maxY): for j in range(maxX): if gamestate[i][j] == 0: continue DrawSquare(j * 5, i * 3, gamestate[i][j]) def MoveLeft(): pass def MoveRight(): pass def MoveDown(): pass def MoveUp(): pass # Init stdscr = curses.initscr() stdscr.noecho() while True: FullDraw() userin = stdscr.getch() if userin == 'q': break if userin in key_left: MoveLeft() elif userin in key_right: MoveRight() elif userin in key_down: MoveDown() elif userin in key_up: MoveUp() curses.endwin()