Example #1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            Vector2 thicknessCorrection = new Vector2((thickness / 2) * Math.Sign(speed.Y), (thickness / 2) * -Math.Sign(speed.X));

            ShapeRenderer.DrawLine(spriteBatch, startPosition + thicknessCorrection, Position + speed + thicknessCorrection, Color.Red, thickness, .8f);

            Vector2 random = new Vector2(MyMaths.RandomInRange(-thickness / 4, thickness / 4), MyMaths.RandomInRange(-thickness / 4, thickness / 4));

            ShapeRenderer.DrawLine(spriteBatch, startPosition + random + thicknessCorrection / 3, Position + speed / 2 + random + thicknessCorrection / 3, Color.Pink, thickness / 3, .8f);

            base.Draw(spriteBatch);
        }