Ejemplo n.º 1
0
    def __init__(self, view):
        self.view = view
        self.fc = None

        self.__perf_window = psw.PerfStatsWindow()
        self.__settings_vc = tbvc.TabBarVC(stw.SettingsTabbedWindow(), 
            tab_change_event=common.constants.EVENT_SETTINGS_TAB_SEL_CHANGED)
        self.__settings_vc.push_child("Video", vsvc.VideoSettingsVC(vsw.VideoSettingsWindow()))
        self.__settings_vc.push_child("Game", gsvc.GameSettingsVC(gsw.GameSettingsWindow()))
        self.__settings_shown = False
        self.__session_window = sw.SessionWindow()
Ejemplo n.º 2
0
    def __init__(self, view):
        self.__view = view
        self.__perf_view = psw.PerfStatsWindow()
        self.__settings_vc = tbvc.TabBarVC(stw.SettingsTabbedWindow(), 
            tab_change_event=common.constants.EVENT_SETTINGS_TAB_SEL_CHANGED)
        self.__settings_vc.push_child("Video", vsvc.VideoSettingsVC(vsw.VideoSettingsWindow()))
        self.__settings_vc.push_child("Game", gsvc.GameSettingsVC(gsw.GameSettingsWindow()))
        self.__settings_shown = False

        self.__view.fac_names = [fac["name"] for fac in pf.get_factions_list()]
        assert len(self.__view.fac_names) > 0
        if len(self.__view.fac_names) >= 2:
            self.__view.active_fac_idx = 1
        else:
            self.__view.active_fac_idx = 0
Ejemplo n.º 3
0
    war_on = True

    for unit in red_army_units:
        atk_pos = (-100, 0)
        unit.attack(atk_pos)

    for unit in blue_army_units:
        atk_pos = (+100, 0)
        unit.attack(atk_pos)


def toggle_pause(user, event):

    if event[0] == pf.SDL_SCANCODE_P:
        ss = pf.get_simstate()
        if ss == pf.G_RUNNING:
            pf.set_simstate(pf.G_PAUSED_UI_RUNNING)
        else:
            pf.set_simstate(pf.G_RUNNING)


setup_scene()
setup_armies()
fixup_anim_combatable()

perf_stats_win = psw.PerfStatsWindow()
perf_stats_win.show()

pf.register_event_handler(pf.SDL_KEYDOWN, start_war, None)
pf.register_ui_event_handler(pf.SDL_KEYDOWN, toggle_pause, None)