Esempio n. 1
0
        public override void LoadContent()
        {
            if (_contentManager == null)
            {
                _contentManager = new ContentManager(ScreenManager.Game.Services);
            }
            _lineBrush.Load(ScreenManager.GraphicsDevice);

            _rectangleTexture = DrawingHelper.CreateRectangleTexture(ScreenManager.GraphicsDevice, 128, 128, Color.Gold,
                                                                     Color.Black);
            _rectangleOrigin = new Vector2(_rectangleTexture.Width / 2f, _rectangleTexture.Height / 2f);

            _circleTexture = DrawingHelper.CreateCircleTexture(ScreenManager.GraphicsDevice, 64, Color.White,
                                                               Color.Black);
            _circleOrigin = new Vector2(_circleTexture.Width / 2f, _circleTexture.Height / 2f);

            _rectangleBody          = BodyFactory.Instance.CreateRectangleBody(PhysicsSimulator, 128, 128, 1);
            _rectangleBody.Position = new Vector2(256, 384);
            _rectangleGeom          = GeomFactory.Instance.CreateRectangleGeom(PhysicsSimulator, _rectangleBody, 128, 128);

            _circleBody          = BodyFactory.Instance.CreateCircleBody(PhysicsSimulator, 64, 1); //fix
            _circleBody.Position = new Vector2(725, 384);
            _circleGeom          = GeomFactory.Instance.CreateCircleGeom(PhysicsSimulator, _circleBody, 64, 20);

            base.LoadContent();
        }
Esempio n. 2
0
        public override void LoadContent()
        {
            _circleBrush = new CircleBrush(64, Color.White, Color.Black);
            _circleBrush.Load(ScreenManager.GraphicsDevice);

            _circleBody          = BodyFactory.Instance.CreateCircleBody(PhysicsSimulator, 64, 1);
            _circleBody.Position = new Vector2(725, 384);
            _circleGeom          = GeomFactory.Instance.CreateCircleGeom(PhysicsSimulator, _circleBody, 64, 20);

            _rectangleBody          = BodyFactory.Instance.CreateRectangleBody(PhysicsSimulator, 128, 128, 1);
            _rectangleBody.Position = new Vector2(256, 384);
            _rectangleGeom          = GeomFactory.Instance.CreateRectangleGeom(PhysicsSimulator, _rectangleBody, 128, 128);

            _rectangleBrush = new RectangleBrush(128, 128, Color.Gold, Color.Black);
            _rectangleBrush.Load(ScreenManager.GraphicsDevice);

            _p1 = ScreenManager.ScreenCenter;
            _p2 = _circleGeom.Position;

            _lineBrush = new LineBrush(1, Color.Black);
            _lineBrush.Load(ScreenManager.GraphicsDevice);

            _marker = new CircleBrush(3, Color.Red, Color.Red);
            _marker.Load(ScreenManager.GraphicsDevice);

            base.LoadContent();
        }
Esempio n. 3
0
        public override void LoadContent()
        {
            _lineBrush.Load(ScreenManager.GraphicsDevice);

            _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 - 125));
            _pyramid.Load(PhysicsSimulator);

            _floor = new Floor(ScreenManager.ScreenWidth, 100,
                               new Vector2(ScreenManager.ScreenCenter.X, ScreenManager.ScreenHeight - 50));
            _floor.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);

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

            base.LoadContent();
        }
        private void LoadSliderJointContent(GraphicsDevice graphicsDevice)
        {
            _sliderJointLineBrush      = new LineBrush(_sliderJointLineThickness, _sliderJointColor);
            _sliderJointRectangleBrush = new RectangleBrush(10, 10, _sliderJointColor, _sliderJointColor);

            _sliderJointLineBrush.Load(graphicsDevice);
            _sliderJointRectangleBrush.Load(graphicsDevice);
        }
        private void LoadRevoluteJointContent(GraphicsDevice graphicsDevice)
        {
            _revoluteJointLineBrush      = new LineBrush(_revoluteJointLineThickness, _revoluteJointColor);
            _revoluteJointRectangleBrush = new RectangleBrush(10, 10, _revoluteJointColor, _revoluteJointColor);

            _revoluteJointLineBrush.Load(graphicsDevice);
            _revoluteJointRectangleBrush.Load(graphicsDevice);
        }
        private void LoadSpringContent(GraphicsDevice graphicsDevice)
        {
            _springLineBrush   = new LineBrush(_springLineThickness, _springLineColor);
            _springCircleBrush = new CircleBrush(2, _springLineColor, _springLineColor);

            _springLineBrush.Load(graphicsDevice);
            _springCircleBrush.Load(graphicsDevice);
        }
Esempio n. 7
0
        /// <summary>
        /// Load graphics content for the screen.
        /// </summary>
        public virtual void LoadContent()
        {
            _lineBrush.Load(ScreenManager.GraphicsDevice);
            _physicsSimulatorView.LoadContent(ScreenManager.GraphicsDevice, ScreenManager.ContentManager);
            int borderWidth = (int)(ScreenManager.ScreenHeight * .05f);

            _border = new Border(ScreenManager.ScreenWidth, ScreenManager.ScreenHeight, borderWidth, ScreenManager.ScreenCenter);
            _border.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);
        }
Esempio n. 8
0
        public override void LoadContent()
        {
            _lineBrush.Load(ScreenManager.GraphicsDevice);
            LoadAgent();
            LoadFloor();
            LoadObstacles();

            base.LoadContent();
        }
Esempio n. 9
0
        public override void LoadContent()
        {
            _lineBrush.Load(ScreenManager.GraphicsDevice);

            int borderWidth = (int)(ScreenManager.ScreenHeight * .05f);

            _border = new Border(ScreenManager.ScreenWidth + borderWidth * 2, ScreenManager.ScreenHeight + borderWidth * 2,
                                 borderWidth, ScreenManager.ScreenCenter);
            _border.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);

            _agent = new Agent(new Vector2(ScreenManager.ScreenCenter.X, 100));
            _agent.CollisionCategory = CollisionCategories.Cat5;
            _agent.CollidesWith      = CollisionCategories.All & ~CollisionCategories.Cat4;
            //collide with all but Cat4 (black)
            _agent.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);

            LoadPlatforms();

            base.LoadContent();
        }
Esempio n. 10
0
        public override void LoadContent()
        {
            _lineBrush.Load(ScreenManager.GraphicsDevice);

            int borderWidth = (int)(ScreenManager.ScreenHeight * .05f);

            _border = new Border(ScreenManager.ScreenWidth, ScreenManager.ScreenHeight, borderWidth,
                                 ScreenManager.ScreenCenter);
            _border.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);

            _agent = new Agent(ScreenManager.ScreenCenter - new Vector2(200, 0));
            _agent.CollisionCategory = CollisionCategories.Cat5;
            _agent.CollidesWith      = CollisionCategories.All & ~CollisionCategories.Cat4;
            //collide with all but Cat4 (black)
            _agent.Load(ScreenManager.GraphicsDevice, PhysicsSimulator);
            _agent.Body.LinearDragCoefficient = .001f;

            LoadSpiders();

            base.LoadContent();
        }
 private void LoadCoordinateAxisContent(GraphicsDevice graphicsDevice)
 {
     _coordinateAxisLineBrush = new LineBrush(_coordinateAxisLineThickness, _coordinateAxisColor);
     _coordinateAxisLineBrush.Load(graphicsDevice);
 }
 private void LoadAABBContent(GraphicsDevice graphicsDevice)
 {
     //load aabb texture
     _aabbLineBrush = new LineBrush(_aabbLineThickness, _aabbColor);
     _aabbLineBrush.Load(graphicsDevice);
 }
 private void LoadEdgeContent(GraphicsDevice graphicsDevice)
 {
     _edgeLineBrush = new LineBrush(_edgeLineThickness, _edgeColor);
     _edgeLineBrush.Load(graphicsDevice);
 }
Esempio n. 14
0
        public override void LoadContent()
        {
            _lineBrush.Load(ScreenManager.GraphicsDevice);

            base.LoadContent();
        }