Esempio n. 1
0
        protected override void Initialize()
        {
            // Set asset directory
            Content.ContentRoot = "../../assets";

            // Create the python vm
            python = new PythonVM (this);

            // Load the python script
            python.LoadLive (Content.Load<PythonScript> ("animation"));
            python ["init"] ();

            base.Initialize ();
        }
Esempio n. 2
0
        protected override void Initialize()
        {
            // Set asset directory
            Content.ContentRoot = "../../assets";

            // Create the python vm
            python = new PythonVM(this);

            // Load the python script
            python.LoadLive(Content.Load <PythonScript> ("animation"));
            python ["init"] ();

            base.Initialize();
        }
Esempio n. 3
0
 PythonGame(string assetRoot)
 {
     var root = assetRoot == string.Empty
         ? AppDomain.CurrentDomain.BaseDirectory
         : assetRoot;
     Python = new PythonVM ();
     Content = new ContentManager (root);
     Content.RegisterAssetHandler<PythonScript> (typeof(PythonScriptProvider));
     exitLoop = false;
 }
Esempio n. 4
0
        protected override void Initialize()
        {
            // Register map handler for saving and loading maps
            Content.RegisterAssetHandler<Map> (typeof(MapHandler));

            // Create texture lookup
            Textures = new TextureLookup ();
            LoadTextures ();
            SerializeTestMap ();

            // Initialize python vm
            Python = new PythonVM (this);
            var original = Python.Reloader.LoadScript;
            Python.Reloader.LoadScript = new Action<nginz.Common.Script> (script => {
                original (script);
                Python.Call ("loadcontent", this, Content);
            });
            LoadScripts ();
            Python.Call ("initialize", this);

            base.Initialize ();
        }
Esempio n. 5
0
        protected override void Initialize()
        {
            // Register map handler for saving and loading maps
            Content.RegisterAssetHandler <Map> (typeof(MapHandler));

            // Create texture lookup
            Textures = new TextureLookup();
            LoadTextures();
            SerializeTestMap();

            // Initialize python vm
            Python = new PythonVM(this);
            var original = Python.Reloader.LoadScript;

            Python.Reloader.LoadScript = new Action <nginz.Common.Script> (script => {
                original(script);
                Python.Call("loadcontent", this, Content);
            });
            LoadScripts();
            Python.Call("initialize", this);

            base.Initialize();
        }
Esempio n. 6
0
 protected override void Update(GameTime time)
 {
     python ["update"] ();
     base.Update(time);
 }