def toggle_war(user, event): if event[0] != pf.SDL_SCANCODE_W: return global war_on if war_on: pf.set_diplomacy_state(0, 1, pf.DIPLOMACY_STATE_PEACE) war_on = False else: pf.set_diplomacy_state(0, 1, pf.DIPLOMACY_STATE_WAR) war_on = True
def setup_scene(): pf.set_ambient_light_color((1.0, 1.0, 1.0)) pf.set_emit_light_color((1.0, 1.0, 1.0)) pf.set_emit_light_pos((1664.0, 1024.0, 384.0)) pf.new_game("assets/maps", "plain.pfmap") pf.add_faction("RED", (255, 0, 0, 255)) pf.add_faction("BLUE", (0, 0, 255, 255)) pf.set_diplomacy_state(0, 1, pf.DIPLOMACY_STATE_PEACE) pf.set_faction_controllable(0, False) pf.set_faction_controllable(1, False)
def setup_scene(): pf.set_ambient_light_color((1.0, 1.0, 1.0)) pf.set_emit_light_color((1.0, 1.0, 1.0)) pf.set_emit_light_pos((1664.0, 1024.0, 384.0)) pf.settings_set("pf.game.fog_of_war_enabled", False, persist=False) pf.new_game("assets/maps", "plain.pfmap") pf.add_faction("RED", (255, 0, 0, 255)) pf.add_faction("BLUE", (0, 0, 255, 255)) pf.set_diplomacy_state(0, 1, pf.DIPLOMACY_STATE_WAR) pf.set_faction_controllable(0, False) pf.set_faction_controllable(1, False)
# Global configs # ############################################################ pf.set_ambient_light_color((1.0, 1.0, 1.0)) pf.set_emit_light_color((1.0, 1.0, 1.0)) pf.set_emit_light_pos((1664.0, 1024.0, 384.0)) pf.set_active_font("OptimusPrinceps.ttf") ############################################################ # Setup map/scene # ############################################################ pf.load_map("assets/maps", "demo.pfmap") globals.scene_objs = pf.load_scene("assets/maps/demo.pfscene") pf.set_diplomacy_state(1, 2, pf.DIPLOMACY_STATE_WAR) pf.set_diplomacy_state(1, 3, pf.DIPLOMACY_STATE_WAR) pf.set_diplomacy_state(2, 3, pf.DIPLOMACY_STATE_WAR) pf.set_faction_controllable(0, False) pf.set_faction_controllable(2, False) pf.set_faction_controllable(3, False) ############################################################ # Setup global events # ############################################################ main_cam = pf.get_active_camera() debug_cam = pf.Camera(mode=pf.CAM_MODE_FPS, position=(0.0, 175.0, 0.0), pitch=-65.0,