예제 #1
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.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)
예제 #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)
예제 #3
0
        print("        METHODS")
        print(
            "        ************************************************************************"
        )
    for method in methods:
        print("        [{0}]".format(method.__name__))
        print("        {0}".format(wrapper8.fill(method.__doc__)))
        print("")

print(
    "********************************************************************************"
)
print("BUILT-IN CONSTANTS")
print(
    "********************************************************************************"
)
print("")

for const in [
        attr for attr in dir(pf)
        if (isinstance(getattr(pf, attr), types.IntType)
            or isinstance(getattr(pf, attr), types.LongType)
            or isinstance(getattr(pf, attr), types.FloatType)
            or isinstance(getattr(pf, attr), types.StringType) or isinstance(
                getattr(pf, attr), types.UnicodeType)) and attr != '__name__'
]:
    print("    {0} {1}".format(const, getattr(pf, const)))

pf.new_game("assets/maps", "demo.pfmap")  # for a clean exit
pf.global_event(pf.SDL_QUIT, None)
예제 #4
0
from constants import *
from units import *

############################################################
# 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))

############################################################
# Setup map/scene                                          #
############################################################

pf.new_game("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                                      #
############################################################

active_cam_idx = 0
예제 #5
0
############################################################
# Debugging setup                                          #
############################################################


def on_task_exc(user, event):
    traceback.print_exception(event[1], event[2], event[3])


pf.register_event_handler(pf.EVENT_SCRIPT_TASK_EXCEPTION, on_task_exc, None)

############################################################
# Global configs                                           #
############################################################

pf.new_game("assets/maps", "plain.pfmap")
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.disable_fog_of_war()
pf.set_minimap_size(0)
pf.disable_unit_selection()

############################################################
# Camera setup                                             #
############################################################

pong_cam = pf.Camera(mode=pf.CAM_MODE_FREE,
                     position=(0.0, 175.0, 0.0),
                     pitch=-90.0,
                     yaw=180.0)
예제 #6
0
import pf
import ui
import sinbad as sb

from constants import *

############################################################
# 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([1024.0, 768.0, 768.0])

pf.new_game("assets/maps", "demo-arena.pfmap")
pf.set_map_render_mode(CHUNK_RENDER_MODE_PREBAKED)

############################################################
# Setup entities                                           #
############################################################

sinbad = sb.Sinbad("assets/models/sinbad", "Sinbad.pfobj", "Sinbad")
sinbad.pos = [-80.0, 18.0, -95.0]
sinbad.scale = [1.0, 1.0, 1.0]
sinbad.activate()

oak_tree = pf.Entity("assets/models/oak_tree", "oak_tree.pfobj", "OakTree")
oak_tree.pos = [-40.0, 14.0, -115.0]
oak_tree.scale = [2.0, 2.0, 2.0]
oak_tree.activate()