private void SearchIntersections() // scans if the ball is intersecting with anything
{
for (int i = 0; i < 60; i++)
{
if (pingBall.IntersectsWith(bricks[i]) && brickExists[i] == true)
{
//rectangleGraphics.FillRectangle(blackBrush, bricks[i]);
brickExists[i] = false;
// write code to detect specific wall; WallRebound(0/1/2/3);
System.Drawing.Rectangle leftSide = new System.Drawing.Rectangle(bricks[i].Left, bricks[i].Top, 1, 25);
}
}
if (pingBall.Left < 0)
{
runningVelocity[1] *= -1;
}
if (pingBall.IntersectsWith(topWall))
{
runningVelocity[0] *= -1;
}
if (pingBall.Right > 450)
{
runningVelocity[1] *= -1;
}
if (pingBall.IntersectsWith(bottomWall))
{
YouDroppedTheBallOnThisOne();
}
if (pingBall.IntersectsWith(paddle))
{
CurryRebound();
}
}