Esempio n. 1
0
File: Ball.cs Progetto: 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);
 }
Esempio n. 2
0
 public void AddBall(Ball ball)
 {
     Balls.Add(ball);
 }
Esempio n. 3
0
File: Form1.cs Progetto: AtanasK/VP
 private void Form1_MouseClick(object sender, MouseEventArgs e)
 {
     Ball ball = new Ball(e.Location, currentColor);
     ballsDoc.AddBall(ball);
     Invalidate(true);
 }