Esempio n. 1
0
 def draw(self):
     if self.player is None:
         raise RuntimeError("You didn't call levelManager.setPlayer()!!!!")
     if(config.world.currentLevel == self):
         unicurses.erase()
         self.camera.draw(self.player.xpos, self.player.ypos)
         self.output_buffer.output()
Esempio n. 2
0
 def drawInventoryInputParser(self):
     unicurses.erase()
     self.camera.drawHUDBoundaries()
     for index, item in enumerate(self.player.inventory.inventoryList):
         unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["white"]))
         unicurses.mvaddstr(index+1, 1, self.player.inventory.letterList[index+1]+") "+self.player.inventory.inventoryList[index].description)
         unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["white"]))
Esempio n. 3
0
    noecho()
    cbreak()
    curs_set(0)
    keypad(stdscr, True)
    ESCDELAY = 100
    start_color()

    # Set up the global colorPalette
    for i in range(0, 256):
        config.colorPalette.update({i:[i, i, unicurses.COLOR_BLACK]})
        config.colorDict.update({str(i):i})
    for entry in config.colorPalette:
        unicurses.init_pair(config.colorPalette[entry][0], config.colorPalette[entry][1], config.colorPalette[entry][2])

    # Main menu
    erase()
    selected = 0
    temp_camera = Camera(51, 19, None)
    temp_camera.drawHUDBoundaries()
    while(True):
        if(selected == 0):
            unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["white"]))
            unicurses.mvaddstr(1, 1, "New game")
            unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["white"]))
        else:
            unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["g12"]))
            unicurses.mvaddstr(1, 1, "New game")
            unicurses.attroff(unicurses.COLOR_PAIR(config.colorDict["g12"]))
        if(selected == 1):
            unicurses.attron(unicurses.COLOR_PAIR(config.colorDict["white"]))
            unicurses.mvaddstr(2, 1, "Load game")