def update_effect(effect): _x = effect['pos'][0]-CAMERA_POS[0] _y = effect['pos'][1]-CAMERA_POS[1] _view = gfx.get_view_by_name('map') if _x<0 or _x>=_view['draw_size'][0]-1 or _y<0 or _y>=_view['draw_size'][1]-1: return False gfx.refresh_view_position(_x, _y, 'map')
def update_effect(effect): _x = effect['pos'][0] - CAMERA_POS[0] _y = effect['pos'][1] - CAMERA_POS[1] _view = gfx.get_view_by_name('map') if _x < 0 or _x >= _view['draw_size'][0] - 1 or _y < 0 or _y >= _view[ 'draw_size'][1] - 1: return False gfx.refresh_view_position(_x, _y, 'map')
def draw_all_items(): _view = gfx.get_view_by_name('map') for _item in ITEMS: item = ITEMS[_item] if is_item_owned(item['uid']): continue if item['pos'][0] >= CAMERA_POS[0] and item['pos'][0] < CAMERA_POS[0]+_view['draw_size'][0] and\ item['pos'][1] >= CAMERA_POS[1] and item['pos'][1] < CAMERA_POS[1]+_view['draw_size'][1]: _x = item['pos'][0] - CAMERA_POS[0] _y = item['pos'][1] - CAMERA_POS[1] gfx.blit_char_to_view(_x, _y, item['icon'], (item['color'][0], item['color'][1]), 'map')
def draw_all_items(): _view = gfx.get_view_by_name('map') for _item in ITEMS: item = ITEMS[_item] if is_item_owned(item['uid']): continue if item['pos'][0] >= CAMERA_POS[0] and item['pos'][0] < CAMERA_POS[0]+_view['draw_size'][0] and\ item['pos'][1] >= CAMERA_POS[1] and item['pos'][1] < CAMERA_POS[1]+_view['draw_size'][1]: _x = item['pos'][0]-CAMERA_POS[0] _y = item['pos'][1]-CAMERA_POS[1] gfx.blit_char_to_view(_x, _y, item['icon'], (item['color'][0], item['color'][1]), 'map')
def draw_items(view_size=MAP_WINDOW_SIZE): _view = gfx.get_view_by_name('map') for item_uid in LIFE[SETTINGS['following']]['seen_items']: if not item_uid in ITEMS: continue _item = ITEMS[item_uid] _d_x = _item['pos'][0] - CAMERA_POS[0] _d_y = _item['pos'][1] - CAMERA_POS[1] if _d_x < 0 or _d_x >= MAP_WINDOW_SIZE[ 0] or _d_y < 0 or _d_y >= MAP_WINDOW_SIZE[1]: continue if not alife.sight.is_in_fov(LIFE[SETTINGS['following']], _item['pos']): continue gfx.blit_char_to_view(_d_x, _d_y, _item['icon'], (_item['color'][0], _item['color'][1]), 'map')
def draw_items(view_size=MAP_WINDOW_SIZE): _view = gfx.get_view_by_name('map') for item_uid in LIFE[SETTINGS['following']]['seen_items']: if not item_uid in ITEMS: continue _item = ITEMS[item_uid] _d_x = _item['pos'][0]-CAMERA_POS[0] _d_y = _item['pos'][1]-CAMERA_POS[1] if _d_x < 0 or _d_x >= MAP_WINDOW_SIZE[0] or _d_y < 0 or _d_y >= MAP_WINDOW_SIZE[1]: continue if not alife.sight.is_in_fov(LIFE[SETTINGS['following']], _item['pos']): continue gfx.blit_char_to_view(_d_x, _d_y, _item['icon'], (_item['color'][0], _item['color'][1]), 'map')