Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x1 = button1.Location.X;
- int y1 = button1.Location.Y;
- int x2 = button2.Location.X;
- int y2 = button2.Location.Y;
- if (x2 >= 1480 || x2 <= 0 || y2 >=780 || y2 <=0)
- {
- button2.Location = new Point(ran.Next(1, 148)*10, ran.Next(1, 78)*10);
- }
- if (x1-x2<50&&x1-x2>0)
- {
- button2.Location = new Point(x2 - level, y2);
- }
- if(x1-x2<0&&x1-x2>-50)
- {
- button2.Location = new Point(x2 + level, y2);
- }
- if(y1-y2<50&&y1-y2>0)
- {
- button2.Location = new Point(x2, y2 - level);
- }
- if(y1-y2<0&&y1-y2>-50)
- {
- button2.Location = new Point(x2, y2 + level);
- }
- if(button1.Location == button2.Location)
- {
- level += 10;
- cought++;
- button2.Location = new Point(ran.Next(1, 148)*10, ran.Next(1, 78)*10);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement