public Form1() { InitializeComponent(); topcinja = new BallDoc(); timer1.Start(); this.DoubleBuffered = true; r = new Random(); for (int i = 0; i < 4; i++) { int x = r.Next(2 * BlackBall.Radius, this.Width - 2 * BlackBall.Radius); int y = r.Next(2 * BlackBall.Radius, this.Height - 2 * BlackBall.Radius); Point center = new Point(x, y); BlackBall blackBall = new BlackBall(center); topcinja.AddBlackBall(blackBall); } }
public void AddBlackBall(BlackBall b) { blackBalls.Add(b); }