Ejemplo n.º 1
0
    def draw(self):
        '''Draws the object to the background console.'''

        # ONLY draw objects _if_ they are in view of the player
        if libtcod.map_is_in_fov(self.map.fov_map, self.x, self.y):
            libtcod.console_set_foreground_color(self.con, self.color)
            libtcod.console_put_char(self.con, self.x, self.y, self.char,
                libtcod.BKGND_NONE)
Ejemplo n.º 2
0
    def draw(self, con):
        lt.console_set_default_foreground(con, self.color)
        lt.console_put_char(con, self.col, self.row, self.symbol, lt.BKGND_NONE)

        # Just an arrow to make direction more obvious. Remove later.
        if self.facing == "N":
            lt.console_put_char(con, self.col, self.row-1, '^', lt.BKGND_NONE)
        elif self.facing == "S":
            lt.console_put_char(con, self.col, self.row+1, 'v', lt.BKGND_NONE)
        elif self.facing == "W":
            lt.console_put_char(con, self.col-1, self.row, '<', lt.BKGND_NONE)
        elif self.facing == "E":
            lt.console_put_char(con, self.col+1, self.row, '>', lt.BKGND_NONE)
Ejemplo n.º 3
0
    def clear(self):
        '''Removes the object from the background console.'''

        libtcod.console_put_char(self.con, self.x, self.y, ' ',
                libtcod.BKGND_NONE)
Ejemplo n.º 4
0
 def draw(self, being, con):
     lt.console_set_default_foreground(con, self.color)
     if self.held == "R":
         if being.facing == "N":
             lt.console_put_char(con, being.col+1, being.row, 196, lt.BKGND_NONE)
         elif being.facing == "S":
             lt.console_put_char(con, being.col-1, being.row, 196, lt.BKGND_NONE)
         elif being.facing == "W":
             lt.console_put_char(con, being.col, being.row-1, 179, lt.BKGND_NONE)
         elif being.facing == "E":
             lt.console_put_char(con, being.col, being.row+1, 179, lt.BKGND_NONE)
     elif self.held == "L":
         if being.facing == "S":
             lt.console_put_char(con, being.col + 1, being.row, 196, lt.BKGND_NONE)
         elif being.facing == "N":
             lt.console_put_char(con, being.col - 1, being.row, 196, lt.BKGND_NONE)
         elif being.facing == "E":
             lt.console_put_char(con, being.col, being.row - 1, 179, lt.BKGND_NONE)
         elif being.facing == "W":
             lt.console_put_char(con, being.col, being.row + 1, 179, lt.BKGND_NONE)