//adjust color opacicty for all balls or just one ball private void OpacityTrackBar_ValueChanged(object sender, EventArgs e) { label2.Text = OpacityTrackBar.Value.ToString(); //if checked all balls opacity changes if (AllBalls.Checked) { for (int i = 0; i < _balls.Count; i++) { _balls[i].opacity = OpacityTrackBar.Value; } } //only last created ball moves else { ball list = _balls.LastOrDefault(); list.opacity = OpacityTrackBar.Value; } }
//adjust y velocity for one ball or all balls private void YtrackBar_ValueChanged(object sender, EventArgs e) { label6.Text = YtrackBar.Value.ToString(); //if checked all balls move if (AllBalls.Checked) { for (int i = 0; i < _balls.Count; i++) { _balls[i].YVel = YtrackBar.Value; } } //last ball created ball moves else { ball list = _balls.LastOrDefault(); list.YVel = YtrackBar.Value; } }
//adjust x velocity for all balls ore one ball private void XtrackBar_ValueChanged(object sender, EventArgs e) { label5.Text = XtrackBar.Value.ToString(); //if checked all balls move if (AllBalls.Checked) { for (int i = 0; i < _balls.Count; i++) { _balls[i].XVel = XtrackBar.Value; } } //only last made ball moves else { ball list = _balls.LastOrDefault(); list.XVel = XtrackBar.Value; } }