Example #1
0
        public override void LoadContent()
        {
            base.LoadContent();

            World.Gravity = new Vector2(0f, 20f);

            _border = new Border(World, Lines, Framework.GraphicsDevice);

            _ragdoll = new Ragdoll(World, new Vector2(-20f, -10f));

            _obstacles = new Body[9];
            Vector2 stairStart = new Vector2(-23f, 0f);
            Vector2 stairDelta = new Vector2(2.5f, 1.65f);

            for (int i = 0; i < 9; i++)
            {
                _obstacles[i] = BodyFactory.CreateRectangle(World, 5f, 1.5f, 1f, stairStart + stairDelta * i);
                _obstacles[i].IsStatic = true;
            }

            // create sprite based on body
            _obstacle = new Sprite(ContentWrapper.TextureFromShape(_obstacles[0].FixtureList[0].Shape, "Stripe", ContentWrapper.Red, ContentWrapper.Black, ContentWrapper.Black, 1.5f));

            SetUserAgent(_ragdoll.Body, 1000f, 400f);
        }
Example #2
0
        public override void LoadContent()
        {
            base.LoadContent();

            World.Gravity = new Vector2(0f, 20f);

            _border = new Border(World, ScreenManager, Camera);
            _ragdoll = new Ragdoll(World, ScreenManager, Vector2.Zero);

            LoadObstacles();
            SetUserAgent(_ragdoll.Body, 1000f, 400f);
        }