コード例 #1
0
ファイル: HLine.cs プロジェクト: elementalshotz/BouncingBalls
 public void intersect(Ball ball, Boxes box)
 {
     if (ball.box.rect.IntersectsWith(box.rect))
     {
         BallSpeed(ball);
     }
 }
コード例 #2
0
 public void intersect(Ball ball, Boxes box)
 {
     if (ball.box.rect.IntersectsWith(box.rect))
     {
         if ((ball.Speed.X) * 2 <= 10 && (ball.Speed.Y) * 2 <= 10)
         {
             BallSpeed(ball);
         }
     }
 }
コード例 #3
0
 public Ball(Point position, int radius)
 {
     this.position = position;
     this.radius   = radius;
     box           = new Boxes(new Point(position.X - radius, position.Y - radius), new Size(radius * 2, radius * 2), Color.Transparent);
 }