title: C#: Detect which side picturebox collides
body: <p>I am building a simple BreakOut game using Pictureboxes for the ball, bat and blocks.</p>
  
  <pre><code>if( block.Bounds.IntersectsWith(ball.Bounds)){
      // Switch the x OR y direction
      x *= -1;
      // or
      y *= -1;
  }
  </code></pre>
  
  <p>The ball moves like:</p>
  
  <pre><code>speed = 2;
  x = -1; // or 1
  y = -1; // or 1
  ball.Location.X += speed * x;
  ball.Location.Y += speed * y;
  </code></pre>
  
  <p>I need to switch the x direction of the ball when it hits the block on the side
  but it needs to switch the y direction when the ball hits the block on the up or down side.</p>
  
  <p>Is there a way to know where it hit the block?</p>