def draw(self, state): # only show if visible to the player if libtcod.map_is_in_fov(state.fov_map, self.x, self.y) or self.always_visible and state.game_map.game_map[self.x][ self.y].explored: # set the color and then draw the char that represents this object at its position libtcod.console_set_default_foreground(state.con, self.color) libtcod.console_put_char(state.con, self.x, self.y, self.char, libtcod.BKGND_NONE)
def clear(self, con): # erase the character that represents this object libtcod.console_put_char(con, self.x, self.y, ' ', libtcod.BKGND_NONE)