Exemplo n.º 1
0
        public void Render(WorldRenderer wr, Actor self)
        {
            Color trailStart = Color;
            Color trailEnd   = Color.FromArgb(trailStart.A - 255 / TrailLength, trailStart.R, trailStart.G, trailStart.B);

            for (int i = positions.Count - 1 - StartSkip; i >= 4; --i)
            {
                // World positions
                var conPos  = WPos.Average(positions[i], positions[i - 1], positions[i - 2], positions[i - 3]);
                var nextPos = WPos.Average(positions[i - 1], positions[i - 2], positions[i - 3], positions[i - 4]);

                if (!self.World.FogObscures(new CPos(conPos)) &&
                    !self.World.FogObscures(new CPos(nextPos)))
                {
                    Game.Renderer.WorldLineRenderer.DrawLine(wr.ScreenPosition(conPos), wr.ScreenPosition(nextPos), trailStart, trailEnd);

                    trailStart = trailEnd;
                    trailEnd   = Color.FromArgb(trailStart.A - 255 / positions.Count, trailStart.R, trailStart.G, trailStart.B);
                }
            }
        }