0

I wanted to created Lightning bolts to a Windows form App that uses threading. The screen should be like the lightning bolts of The Flash's(DC Comics Superhero) body when running. As of now I have lines drawing and disappearing in my form. I used a thread for this because I will have to add more animations along side with this lightning bolts.

   public void Animate()
    {
        Point xy1;
        Point xy2;
        Random rand=new Random();

        for (int ctr = 1; ctr < 110; ctr++)
        {
            xy1 = new Point(rand.Next(0, this.Width),rand.Next(0, this.Height));
            xy2 = new Point(rand.Next(0, this.Width),rand.Next(0, this.Height));
            CreateGraphics().DrawLine(new Pen(Brushes.Yellow, 1),xy1,xy2);
            Thread.Sleep(100);
            this.Invalidate();



        }


    }
user3293347
  • 35
  • 1
  • 5

0 Answers0