I don't know how to add a for loop or while loop with the condition of: having the picture box move at random coordinates while it is not yet clicked by a mouse.
Random r = new Random();
int x;
int y;
public frmGame()
{
InitializeComponent();
MovePictureBox();
}
private void MovePictureBox()
{
int[] numbers = GenerateRandomNumbers();
picMonkey.Location = new Point(numbers[0], numbers[1]);
}
private int[] GenerateRandomNumbers()
{
int[] RandomNumbers = new int[2];
RandomNumbers[0] = r.Next(0, x);
RandomNumbers[1] = r.Next(0, y);
return RandomNumbers;
}
private void btnOptions_Click(object sender, EventArgs e)
{
frmGameOption frmGameOption = new frmGameOption();
frmGameOption.Show();
}
}