示例#1
0
文件: BallsDoc.cs 项目: AtanasK/VP
 public void AddBall(Point position)
 {
     Random r = new Random();
     int x = r.Next(2);
     Ball ball = null;
     if (x == 0)
     {
         ball = new Ball(Color.Blue, position);
     }
     else if (x == 1)
     {
         ball = new Ball(Color.Green, position);
     }
     Balls.Add(ball);
 }
示例#2
0
文件: Ball.cs 项目: AtanasK/VP
 public bool Touches(Ball b)
 {
     return (Position.X - b.Position.X) * (Position.X - b.Position.X) + (Position.Y - b.Position.Y) * (Position.Y - b.Position.Y) <= RADIUS * RADIUS * 4;
 }
示例#3
0
文件: BallsDoc.cs 项目: AtanasK/VP
 public void AddRed(Point position)
 {
     Ball ball = new Ball(Color.Red, position);
     Balls.Add(ball);
 }