當前位置: 首頁>>代碼示例>>C#>>正文


C# Agent.Load方法代碼示例

本文整理匯總了C#中Agent.Load方法的典型用法代碼示例。如果您正苦於以下問題:C# Agent.Load方法的具體用法?C# Agent.Load怎麽用?C# Agent.Load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Agent的用法示例。


在下文中一共展示了Agent.Load方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LoadContent

        public override void LoadContent()
        {
            _rectangleTexture = DrawingHelper.CreateRectangleTexture(ScreenManager.GraphicsDevice, 32, 32, 2, 0, 0,
                                                                     Color.White, Color.Black);

            _rectangleBody = BodyFactory.Instance.CreateRectangleBody(32, 32, 1f); //template
            _rectangleGeom = GeomFactory.Instance.CreateRectangleGeom(_rectangleBody, 32, 32); //template
            _rectangleGeom.FrictionCoefficient = .4f;
            _rectangleGeom.RestitutionCoefficient = 0f;

            //create the pyramid near the bottom of the screen.
            _pyramid = new Pyramid(_rectangleBody, _rectangleGeom, 32f / 3f, 32f / 3f, 32, 32, _pyramidBaseBodyCount,
                                   new Vector2(ScreenManager.ScreenCenter.X - _pyramidBaseBodyCount * .5f * (32 + 32 / 3),
                                               ScreenManager.ScreenHeight - 60));

            _pyramid.Load(PhysicsSimulator);

            _agent = new Agent(ScreenManager.ScreenCenter - new Vector2(320, 200));
            _agent.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);

            base.LoadContent();
        }
開發者ID:rpwjanzen,項目名稱:2HourGame,代碼行數:22,代碼來源:Demo4Screen.cs

示例2: LoadContent

        public override void LoadContent()
        {
            _agent = new Agent(new Vector2(500, 500));
            _agent.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);

            //LoadObstacles();

            _weldedBody = new List<Body>();
            _weldedGeom = new List<Geom>();

            for (int i = 0; i < 128; i++)
            {
                _weldedBody.Add(BodyFactory.Instance.CreateRectangleBody(25, 25, 10.0f));
                _weldedGeom.Add(GeomFactory.Instance.CreateRectangleGeom(_weldedBody[i], 25, 25));
                _weldedGeom[i].RestitutionCoefficient = 0.0001f;
                _weldedGeom[i].FrictionCoefficient = 0.999f;
                PhysicsSimulator.Add(_weldedBody[i]);
                PhysicsSimulator.Add(_weldedGeom[i]);
            }
            for (int x = 0; x < 8; x++)
            {
                for (int y = 0; y < 16; y++)
                {
                    // Width*y + x
                    _weldedBody[8 * y + x].Position = new Vector2((x * 30) + 80, (y * 30) + 80);
                }
            }
            _weld = new Weld(PhysicsSimulator, _weldedGeom);

            base.LoadContent();
        }
開發者ID:rpwjanzen,項目名稱:2HourGame,代碼行數:31,代碼來源:Demo9ScreenWeld.cs

示例3: LoadContent

        public override void LoadContent()
        {
            _agent = new Agent(ScreenManager.ScreenCenter);
            _agent.CollisionCategory = CollisionCategory.Cat5;
            _agent.CollidesWith = CollisionCategory.All & ~CollisionCategory.Cat4;
            //collide with all but Cat4 (black)
            _agent.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);

            LoadCircles();

            base.LoadContent();
        }
開發者ID:rpwjanzen,項目名稱:2HourGame,代碼行數:12,代碼來源:Demo8Screen.cs

示例4: LoadContent

        public override void LoadContent()
        {
            _agent = new Agent(new Vector2(ScreenManager.ScreenCenter.X, 100));
            _agent.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);

            LoadObstacles();

            base.LoadContent();
        }
開發者ID:rpwjanzen,項目名稱:2HourGame,代碼行數:9,代碼來源:Demo3Screen.cs


注:本文中的Agent.Load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。