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)
Example #2
0
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)
Example #3
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,
                      yaw=135.0)
active_cam = main_cam

Example #4
0
 def __on_controlled_faction_chagned(self, event):
     pf.clear_unit_selection()
     for i in range(len(pf.get_factions_list())):
         pf.set_faction_controllable(i, False)
     pf.set_faction_controllable(event, True)