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); }
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; }
public void AddRed(Point position) { Ball ball = new Ball(Color.Red, position); Balls.Add(ball); }