Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
Arquivo: Ball.cs Projeto: 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;
 }
Exemplo n.º 3
0
 public void AddRed(Point position)
 {
     Ball ball = new Ball(Color.Red, position);
     Balls.Add(ball);
 }