コード例 #1
0
ファイル: simulate.py プロジェクト: d0u0d0e/AI-Sandbox
def main(PreferedRunner, args, **kwargs):
    """
        Setup our custom demo application, as well as a window-mode runner,
        and launch it.  This function returns once the demo is over.
            - If RCTRL+R is pressed, the application is restarted.
            - On RCTRL+F, the game code is dynamically refreshed.
    """

    while True:
        runner = PreferedRunner()

        if not args:
            args = defaults

        app = CaptureTheFlag(args, map = 'map10', **kwargs)
        if not runner.run(app):
            break
        r = app.reset
        del runner
        del app

        if not r:
            break
        else:
            import gc
            gc.collect()

            from reload import reset
            reset()
コード例 #2
0
def main(PreferedRunner, args, accel, **kwargs):
    """
        Setup our custom demo application, as well as a window-mode runner,
        and launch it.  This function returns once the demo is over.
            - If RCTRL+R is pressed, the application is restarted.
            - On RCTRL+F, the game code is dynamically refreshed.
    """

    while True:
        runner = PreferedRunner()
        if accel:
            runner.accelerate()

        if not args:
            args = defaults

        app = CaptureTheFlag(args, **kwargs)
        if not runner.run(app):
            break
        r = app.reset
        del runner
        del app

        if not r:
            break
        else:
            import gc
            gc.collect()

            from reload import reset
            reset()