private void CustomSpawnB_Click(object sender, EventArgs e) { int x = Convert.ToUInt16(textBox4.Text); int y = Convert.ToUInt16(textBox5.Text); Point point = new Point(x, y); Bot bot = new Bot(point); bot.RefreshImage(); ComExec.CreateOriginator(ref bot); MainItems.bots.Add(bot); pictureBox1.Image = MainItems.MainPolygon; }
private void button2_Click(object sender, EventArgs e) { Random rand1 = new Random(); Random rand2 = new Random(); // Point spawn = new Point(rand1.Next(Bot.size,MainItems.MainPolygon.Width-Bot.size), rand2.Next(Bot.size, MainItems.MainPolygon.Height - Bot.size)); Point spawn = new Point((new Random()).Next() % MainItems.MainPolygon.Width, (new Random()).Next() % MainItems.MainPolygon.Height); //// point.Y += Bot.size; //// point.X += Bot.size; // //Point spawn = new Point(300, 300); Bot bot = new Bot(spawn); bot.RefreshImage(); ComExec.CreateOriginator(ref bot); MainItems.bots.Add(bot); pictureBox1.Image = MainItems.MainPolygon; }