Beispiel #1
0
 void Start()
 {
     if (Task != null)
     {
         Task.Delete();
     }
     Task = new TaskObject(Function);
 }
Beispiel #2
0
        protected override void LoadContent()
        {
            GraphicsDeviceManager.PreferredBackBufferWidth  = 640;
            GraphicsDeviceManager.PreferredBackBufferHeight = 480;
            GraphicsDeviceManager.PreferMultiSampling       = false;
            GraphicsDeviceManager.ApplyChanges();

            Resources.ContentManager = Content;

            Engine.Init();
            Font.Init();
            Script.Init();

            Libs.Register();

            SpriteBatch = new SpriteBatch(GraphicsDevice);
            Graphics.GraphicsDeviceManager = GraphicsDeviceManager;
            Graphics.GraphicsDevice        = GraphicsDevice;

            Graphics.SpriteBatch = SpriteBatch;
            Graphics.BasicEffect = new BasicEffect(GraphicsDevice);
            Graphics.BasicEffect.TextureEnabled                 = true;
            Graphics.BasicEffect.LightingEnabled                = false;
            Graphics.BasicEffect.VertexColorEnabled             = false;
            Graphics.RasterizerStatePrimitive                   = new RasterizerState();
            Graphics.RasterizerStatePrimitive.CullMode          = CullMode.None;
            Graphics.RasterizerStatePrimitive.DepthClipEnable   = false;
            Graphics.RasterizerStatePrimitive.ScissorTestEnable = false;
            Graphics.RasterizerStateSprite                             = new RasterizerState();
            Graphics.RasterizerStateSprite.CullMode                    = CullMode.None;
            Graphics.RasterizerStateSprite.DepthClipEnable             = false;
            Graphics.RasterizerStateSprite.ScissorTestEnable           = false;
            Graphics.DepthStencilStatePrimitive                        = new DepthStencilState();
            Graphics.DepthStencilStatePrimitive.DepthBufferEnable      = false;
            Graphics.DepthStencilStatePrimitive.DepthBufferWriteEnable = false;
            Graphics.DepthStencilStatePrimitive.StencilEnable          = false;
            Graphics.DepthStencilStateSprite                           = new DepthStencilState();
            Graphics.DepthStencilStateSprite.DepthBufferEnable         = false;
            Graphics.DepthStencilStateSprite.DepthBufferWriteEnable    = false;
            Graphics.DepthStencilStateSprite.StencilEnable             = false;
            Graphics.SamplerStatePrimitive                             = new SamplerState();
            Graphics.SamplerStatePrimitive.Filter                      = TextureFilter.Linear;
            Graphics.SamplerStatePrimitive.AddressU                    = TextureAddressMode.Wrap;
            Graphics.SamplerStatePrimitive.AddressV                    = TextureAddressMode.Wrap;
            Graphics.SamplerStateSprite          = new SamplerState();
            Graphics.SamplerStateSprite.Filter   = TextureFilter.Linear;
            Graphics.SamplerStateSprite.AddressU = TextureAddressMode.Wrap;
            Graphics.SamplerStateSprite.AddressV = TextureAddressMode.Wrap;

            var l = new System.Collections.Generic.List <string>();

            foreach (var p in Graphics.BasicEffect.Parameters)
            {
                l.Add(p.Name);
            }
            //Console.WriteLine(String.Join(", ", l));

            Primitive.CreateBasicPrimitives();
            UserPrimitive.UpdateCircularBar(false);

            MainTask = new TaskObject(Script.LoadFile("init.script"));
            Stage.NextStage();

            new Player();
        }
Beispiel #3
0
 Stage(string path)
 {
     Function = Script.LoadFile(path);
     Task     = null;
 }