示例#1
0
def start(loadfile=None):

    print("引擎初始化中……\n")
    console.init()
    print("游戏数据载入中……\n")
    entity.init()
    print("世界构建中……\n")
    context.init()

    m = Map.one("MAP_SUZHOUCHENG")
    player = Person.one("PERSON_PLAYER")

    team_player = Team()
    team_player.include(player)
    team_player.leader = player
    team_player.scenario = m

    context.map = m
    context.PLAYER = player
    context.teams[team_player.id] = team_player

    m.locate(team_player, (18, 27))

    m.window_center(m.location(team_player))

    if loadfile is not None:
        print("存档文件加载中……\n")
        saveload.load(loadfile)
    engine.init()
    engine.start()
示例#2
0
sys.path.append(os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../../"))

from proj import data

from proj.runtime import context

from proj import console

from proj import engine
from proj.engine import script

from proj.entity import Person
from proj.entity import Map

console.init()


if __name__ == "__main__":
    player = Person.one("PERSON_PLAYER")
    map = Map.one("MAP_SUZHOUCHENG")
    time_1 = time.time()
    script.run(data.scripts.SCRIPT_WANPENGFEI_1, timeflow=1, 
               subject=Person.one("PERSON_PLAYER"), 
               object=Person.one("PERSON_WAN_PENGFEI"))
    #script.run2(data.scripts.SCRIPT_WANPENGFEI_TEST, timeflow=1,
    #            subject=player,
    #            object=Person.one("PERSON_WAN_PENGFEI"))
    time_2 = time.time()
    print(time_2 - time_1)
    engine.start()