private void AddBallTimer(object sender, EventArgs e) { if (tickCounter < 10) { tickCounter++; } else { Ball b = new Ball(this); b.Width = 40; b.Height = 40; b.Text = ""; count.ToString(); this.Controls.Add(b); Random r = new Random(); b.LoadBall(new Point(r.Next(this.Width),r.Next(this.Height))); b.BallMove += BallMove; count++; tickCounter = 0; } }
void AddBall() { Ball b = new Ball(this); b.Width = 40; b.Height = 40; b.Text = ""; count.ToString(); this.Controls.Add(b); b.LoadBall(new Point((_bar.Location.X + _bar.Width / 2), _bar.Location.Y -_bar.Height-10)); b.BallMove += BallMove; count++; }