Exemplo n.º 1
0
def terraform():
	move_camera(CURSOR_POS)
	render_map.render_map(WORLD_INFO['map'], view_size=WINDOW_SIZE)
	maps.render_lights(size=WINDOW_SIZE, show_weather=False)
	items.draw_all_items()
	menus.align_menus()
	menus.draw_menus()
	gfx.start_of_frame()
	gfx.end_of_frame()
Exemplo n.º 2
0
def terraform():
    move_camera(CURSOR_POS)
    render_map.render_map(WORLD_INFO['map'], view_size=WINDOW_SIZE)
    maps.render_lights(size=WINDOW_SIZE, show_weather=False)
    items.draw_all_items()
    menus.align_menus()
    menus.draw_menus()
    gfx.start_of_frame()
    gfx.end_of_frame()
Exemplo n.º 3
0
def main():
    _player_moved = False
    _refresh_map = False

    get_input()
    handle_input()

    if not LIFE[SETTINGS['controlling']]['dead']:
        if LIFE[SETTINGS['controlling']]['asleep']:
            gfx.fade_to_black(255)
            gfx.start_of_frame()
            gfx.end_of_frame()

        while LIFE[SETTINGS['controlling']]['asleep']:
            _played_moved = True
            _refresh_map = True

            gfx.title(LIFE[SETTINGS['controlling']]['asleep_reason'])
            logic.tick_all_objects(ignore_tickrate=True, ignore_pause=True)

            if LIFE[SETTINGS['controlling']]['dead']:
                break
    else:
        _player_moved = True

    if _refresh_map:
        gfx.refresh_view('map')

    if not _player_moved:
        if logic.tick_all_objects(ignore_tickrate=True):
            _player_moved = True

    draw_targeting()
    move_camera(SETTINGS['camera_track'])

    #TODO: Deselect so we can get rid of this call
    if SELECTED_TILES[0]:
        gfx.refresh_view('map')

    if not SETTINGS['last_camera_pos'] == SETTINGS['camera_track'][:]:
        if EVENTS or MENUS:
            _visible_chunks = sight.scan_surroundings(
                LIFE[SETTINGS['following']], judge=False, get_chunks=True)
            alife.brain.flag(LIFE[SETTINGS['following']],
                             'visible_chunks',
                             value=_visible_chunks)

            _cam_x = numbers.clip(
                LIFE[SETTINGS['following']]['pos'][0] - MAP_WINDOW_SIZE[0] / 2,
                0, MAP_SIZE[0] - MAP_WINDOW_SIZE[0] / 2)
            _cam_y = numbers.clip(
                LIFE[SETTINGS['following']]['pos'][1] - MAP_WINDOW_SIZE[1] / 2,
                0, MAP_SIZE[1] - MAP_WINDOW_SIZE[1] / 2)

        else:
            _visible_chunks = sight.scan_surroundings(
                LIFE[SETTINGS['controlling']], judge=False, get_chunks=True)
            alife.brain.flag(LIFE[SETTINGS['controlling']],
                             'visible_chunks',
                             value=_visible_chunks)

        SETTINGS['last_camera_pos'] = SETTINGS['camera_track'][:]

    _cam_x = numbers.clip(
        LIFE[SETTINGS['controlling']]['pos'][0] - MAP_WINDOW_SIZE[0] / 2, 0,
        MAP_SIZE[0] - MAP_WINDOW_SIZE[0] / 2)
    _cam_y = numbers.clip(
        LIFE[SETTINGS['controlling']]['pos'][1] - MAP_WINDOW_SIZE[1] / 2, 0,
        MAP_SIZE[1] - MAP_WINDOW_SIZE[1] / 2)

    maps.render_lights()

    if '--worldmap' in sys.argv:
        render_map.render_map(WORLD_INFO['map'],
                              force_camera_pos=(_cam_x, _cam_y, 2))
    else:
        render_map.render_map(WORLD_INFO['map'],
                              los=LIFE[SETTINGS['controlling']]['fov'],
                              force_camera_pos=(_cam_x, _cam_y, 2))

    items.draw_items()
    life.draw_life()

    if LIFE[SETTINGS['controlling']]['dead'] and not EVENTS:
        if not death():
            return False

    if SETTINGS['draw life info'] and SETTINGS['following']:
        life.draw_life_info()

    gfx.draw_message_box()

    menus.align_menus()
    menus.draw_menus()

    gfx.draw_status_line()
    gfx.draw_console()
    gfx.start_of_frame()
    gfx.end_of_frame()

    if '--fps' in sys.argv:
        print tcod.sys_get_fps()

    if (SETTINGS['recording'] and _player_moved and not EVENTS
            and not MENUS) or '--worldmap' in sys.argv:
        gfx.screenshot()

        if '--worldmap' in sys.argv:
            SETTINGS['running'] = False
Exemplo n.º 4
0
def main():
    _player_moved = False
    _refresh_map = False

    get_input()
    handle_input()

    if not LIFE[SETTINGS["controlling"]]["dead"]:
        if LIFE[SETTINGS["controlling"]]["asleep"]:
            gfx.fade_to_black(255)
            gfx.start_of_frame()
            gfx.end_of_frame()

        while LIFE[SETTINGS["controlling"]]["asleep"]:
            _played_moved = True
            _refresh_map = True

            gfx.title(LIFE[SETTINGS["controlling"]]["asleep_reason"])
            logic.tick_all_objects(ignore_tickrate=True, ignore_pause=True)

            if LIFE[SETTINGS["controlling"]]["dead"]:
                break
    else:
        _player_moved = True

    if _refresh_map:
        gfx.refresh_view("map")

    if not _player_moved:
        logic.tick_all_objects(ignore_tickrate=True)

    draw_targeting()
    move_camera(SETTINGS["camera_track"])

    # TODO: Deselect so we can get rid of this call
    if SELECTED_TILES[0]:
        gfx.refresh_view("map")

    if not SETTINGS["last_camera_pos"] == SETTINGS["camera_track"][:]:
        if EVENTS or MENUS:
            _visible_chunks = sight.scan_surroundings(LIFE[SETTINGS["following"]], judge=False, get_chunks=True)
            alife.brain.flag(LIFE[SETTINGS["following"]], "visible_chunks", value=_visible_chunks)

            _cam_x = numbers.clip(
                LIFE[SETTINGS["following"]]["pos"][0] - MAP_WINDOW_SIZE[0] / 2, 0, MAP_SIZE[0] - MAP_WINDOW_SIZE[0] / 2
            )
            _cam_y = numbers.clip(
                LIFE[SETTINGS["following"]]["pos"][1] - MAP_WINDOW_SIZE[1] / 2, 0, MAP_SIZE[1] - MAP_WINDOW_SIZE[1] / 2
            )

        else:
            _visible_chunks = sight.scan_surroundings(LIFE[SETTINGS["controlling"]], judge=False, get_chunks=True)
            alife.brain.flag(LIFE[SETTINGS["controlling"]], "visible_chunks", value=_visible_chunks)

        SETTINGS["last_camera_pos"] = SETTINGS["camera_track"][:]

    _cam_x = numbers.clip(
        LIFE[SETTINGS["controlling"]]["pos"][0] - MAP_WINDOW_SIZE[0] / 2, 0, MAP_SIZE[0] - MAP_WINDOW_SIZE[0] / 2
    )
    _cam_y = numbers.clip(
        LIFE[SETTINGS["controlling"]]["pos"][1] - MAP_WINDOW_SIZE[1] / 2, 0, MAP_SIZE[1] - MAP_WINDOW_SIZE[1] / 2
    )

    maps.render_lights()

    if "--worldmap" in sys.argv:
        render_map.render_map(WORLD_INFO["map"], force_camera_pos=(_cam_x, _cam_y, 2))
    else:
        render_map.render_map(
            WORLD_INFO["map"], los=LIFE[SETTINGS["controlling"]]["fov"], force_camera_pos=(_cam_x, _cam_y, 2)
        )

    items.draw_items()
    life.draw_life()

    if LIFE[SETTINGS["controlling"]]["dead"] and not EVENTS:
        if not death():
            return False

    if SETTINGS["draw life info"] and SETTINGS["following"]:
        life.draw_life_info()

    gfx.draw_message_box()

    menus.align_menus()
    menus.draw_menus()

    gfx.draw_status_line()
    gfx.draw_console()
    gfx.start_of_frame()
    gfx.end_of_frame()

    if "--fps" in sys.argv:
        print tcod.sys_get_fps()

    if (SETTINGS["recording"] and logic.can_tick()) or "--worldmap" in sys.argv:
        gfx.screenshot()

        if "--worldmap" in sys.argv:
            SETTINGS["running"] = False
Exemplo n.º 5
0
def draw_main_menu():
    menus.align_menus()
    menus.draw_menus()
    draw_message()
    graphics.end_of_frame(draw_map=False)
Exemplo n.º 6
0
def draw_main_menu():
	menus.align_menus()
	menus.draw_menus()
	draw_message()
	graphics.end_of_frame(draw_map=False)
Exemplo n.º 7
0
def map_selection():
	menus.align_menus()
	menus.draw_menus()
	
	gfx.end_of_frame()
Exemplo n.º 8
0
def map_selection():
    menus.align_menus()
    menus.draw_menus()

    gfx.end_of_frame()