示例#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
文件: BallsDoc.cs 项目: AtanasK/VP
 public void AddBall(Ball ball)
 {
     Balls.Add(ball);
 }
示例#3
0
文件: Form1.cs 项目: AtanasK/VP
 private void Form1_MouseClick(object sender, MouseEventArgs e)
 {
     Ball ball = new Ball(e.Location, currentColor);
     ballsDoc.AddBall(ball);
     Invalidate(true);
 }