public void intersect(Ball ball, Boxes box) { if (ball.box.rect.IntersectsWith(box.rect)) { BallSpeed(ball); } }
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); } } }
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); }