Esempio n. 1
0
 private void generateNewCircleAfterClick()
 {
     if (krugovi.Count <= 3 && krugovi.Count > 0)
     {
         random = new Random();
         generateRandomNumber();
         CircleTreta circle = new CircleTreta(randomX, randomY);
         circle.changeBrush(pnlIgra.BackColor);
         krugovi.Add(circle);
     }
 }
Esempio n. 2
0
 private void generateNewCircles()
 {
     random  = new Random();
     randomX = random.Next(15, pnlWidth - 15);
     randomY = random.Next(15, pnlHeight - 15);
     if (krugovi.Count >= 2)
     {
         generateRandomNumber();
         CircleTreta circle = new CircleTreta(randomX, randomY);
         circle.changeBrush(pnlIgra.BackColor);
         krugovi.Add(circle);
     }
     else
     {
         for (int i = 0; i < 2; i++)
         {
             generateRandomNumber();
             CircleTreta circle = new CircleTreta(randomX, randomY);
             circle.changeBrush(pnlIgra.BackColor);
             krugovi.Add(circle);
         }
     }
 }