Example #1
0
 def draw(self, windows):  # pragma: no cover
     body = windows['body']
     body.clear()
     line = 10
     body.addstr(line - 2, 20, 'SPACE JAIL', Color.use('red'))
     body.addstr(line + self.current_option, 20, '#', Color.use('blue'))
     for option in self.options:
         body.addstr(line, 22, option.capitalize(), Color.use('white'))
         line += 1
Example #2
0
 def print_inventory(self, window, inv):  #pragma: no cover
     for i in range(0, len(inv)):
         name_x = 1 if i % 2 is 0 else 40
         name_y = (i / 2) + 1
         q_x = 20 if name_x is 1 else 61
         q_y = name_y
         window.addstr(name_y, name_x, inv[i]['name'], Color.use('white'))
         window.addstr(q_y, q_x, str(inv[i]['quantity']),
                       Color.use('white'))
Example #3
0
 def display_heading(self, window):  # pragma: no cover
     window.clear()
     window.border('|', '|', '-', '-', curses.ACS_ULCORNER,
                   curses.ACS_URCORNER, curses.ACS_LLCORNER,
                   curses.ACS_LRCORNER)
     title = 'Level ' + str(self.current_level)
     window.addstr(1, 10, title, Color.use('yellow'))
Example #4
0
 def color(self):  # pragma: no cover
     colors = {
         'floor': 'red',
         'wall': 'magenta',
         'empty': 'black',
         'corridor': 'blue',
         'stairs_down': 'green',
         'stairs_up': 'green'
     }
     return Color.use(colors[self.type])