Ejemplo n.º 1
0
        private static void RenderBoid(Graphics gfx, Boid boid, Color color)
        {
            var boidOutline = new Point[]
            {
                new Point(0, 0),
                new Point(-4, -1),
                new Point(0, 8),
                new Point(4, -1),
                new Point(0, 0),
            };

            using (var brush = new SolidBrush(color))
            {
                gfx.TranslateTransform((float)boid.X, (float)boid.Y);
                gfx.RotateTransform((float)boid.GetAngle());
                gfx.FillClosedCurve(brush, boidOutline);
                gfx.ResetTransform();
            }
        }