Exemple #1
0
        public override void Draw()
        {
            Lines.Begin(ref Camera.SimProjection, ref Camera.SimView);

            foreach (Fixture f in _obstacles.FixtureList)
            {
                Lines.DrawLine(_distanceBody[0].Position, _distanceBody[1].Position, Colors.Black);
                Lines.DrawLine(_distanceBody[2].Position, _distanceBody[3].Position, Colors.Black);
            }

            Lines.End();
            Sprites.Begin(0, null, null, null, null, null, Camera.View);

            for (int i = 0; i < 3; i++)
            {
                Sprites.Draw(_angleCube.Image, ConvertUnits.ToDisplayUnits(_angleBody[i].Position), null, Color.White, _angleBody[i].Rotation, _angleCube.Origin, 1f, SpriteEffects.None, 0f);
            }

            for (int i = 0; i < 4; i++)
            {
                Sprites.Draw(_distanceCube.Image, ConvertUnits.ToDisplayUnits(_distanceBody[i].Position), null, Color.White, _distanceBody[i].Rotation, _distanceCube.Origin, 1f, SpriteEffects.None, 0f);
            }

            Sprites.End();
            Lines.Begin(ref Camera.SimProjection, ref Camera.SimView);

            foreach (Fixture f in _obstacles.FixtureList)
            {
                Lines.DrawLineShape(f.Shape, Colors.Black);
            }

            Lines.End();

            base.Draw();
        }
Exemple #2
0
        public override void Draw(GameTime gameTime)
        {
            Sprites.Begin(0, null, null, null, null, null, Camera.View);

            // draw car
            Sprites.Draw(_wheel.Image, ConvertUnits.ToDisplayUnits(_wheelBack.Position), null, Color.White, _wheelBack.Rotation, _wheel.Origin, 1f, SpriteEffects.None, 0f);
            Sprites.Draw(_wheel.Image, ConvertUnits.ToDisplayUnits(_wheelFront.Position), null, Color.White, _wheelFront.Rotation, _wheel.Origin, 1f, SpriteEffects.None, 0f);
            Sprites.Draw(_carBody.Image, ConvertUnits.ToDisplayUnits(_car.Position), null, Color.White, _car.Rotation, _carBody.Origin, 1f, SpriteEffects.None, 0f);

            // draw teeter
            Sprites.Draw(_teeter.Image, ConvertUnits.ToDisplayUnits(_board.Position), null, Color.White, _board.Rotation, _teeter.Origin, 1f, SpriteEffects.None, 0f);

            // draw bridge
            for (int i = 0; i < _bridgeSegments.Count; ++i)
            {
                Sprites.Draw(_bridge.Image, ConvertUnits.ToDisplayUnits(_bridgeSegments[i].Position), null, Color.White, _bridgeSegments[i].Rotation, _bridge.Origin, 1f, SpriteEffects.None, 0f);
            }

            // draw boxes
            for (int i = 0; i < _boxes.Count; ++i)
            {
                Sprites.Draw(_box.Image, ConvertUnits.ToDisplayUnits(_boxes[i].Position), null, Color.White, _boxes[i].Rotation, _box.Origin, 1f, SpriteEffects.None, 0f);
            }
            Sprites.End();

            Lines.Begin(Camera.SimProjection, Camera.SimView);

            // draw ground
            for (int i = 0; i < _ground.FixtureList.Count; ++i)
            {
                Lines.DrawLineShape(_ground.FixtureList[i].Shape, Color.Black);
            }
            Lines.End();
            base.Draw(gameTime);
        }
Exemple #3
0
        public override void Draw()
        {
            Sprites.Begin(0, null, null, null, null, null, Camera.View);

            for (int i = 0; i < 5; ++i)
            {
                Sprites.Draw(_rectangleSprite.Image, ConvertUnits.ToDisplayUnits(_rectangle[i].Position), null,
                             Color.White, _rectangle[i].Rotation, _rectangleSprite.Origin, 1f, SpriteEffects.None, 0f);
            }

            Sprites.End();
            Lines.Begin(ref Camera.SimProjection, ref Camera.SimView);

            foreach (Fixture f in _ramps.FixtureList)
            {
                Lines.DrawLineShape(f.Shape, Colors.Teal);
            }

            Lines.End();

            base.Draw();
        }