Пример #1
0
Файл: Ball.cs Проект: AtanasK/VP
 public bool IsColiding(Ball ball)
 {
     double d = (Center.X - ball.Center.X) * (Center.X - ball.Center.X) + (Center.Y - ball.Center.Y) * (Center.Y - ball.Center.Y);
     return d <= (2 * RADIUS) * (2 * RADIUS);
 }
Пример #2
0
 public void AddBall(Ball ball)
 {
     Balls.Add(ball);
 }
Пример #3
0
 private void Form1_MouseClick(object sender, MouseEventArgs e)
 {
     Ball ball = new Ball(e.Location, currentColor);
     ballsDoc.AddBall(ball);
     Invalidate(true);
 }