Rectangle intersect code - Is this right?
<p>Can someone tell me whether my rectangle intersect code is correct?</p>

<pre><code>bool checkCollide(int x, int y, int oWidth, int oHeight,
                  int x2, int y2, int o2Width, int o2Height) {

   bool collide = false;

   if (x &gt;= x2 &amp;&amp; x &lt;= x2+o2Width &amp;&amp; y &gt;= y2 &amp;&amp; y &lt;= y2+o2Height)
      collide = true;

   if (x+oWidth &gt;= x2 &amp;&amp; x+oWidth &lt;= x2+o2Width &amp;&amp; y &gt;= y2 &amp;&amp; y &lt;= y2+o2Height)
      collide = true;

   if (x &gt;= x2 &amp;&amp; x&lt;= x2+o2Width &amp;&amp; y+oHeight &gt;= y2 &amp;&amp; y+oHeight &lt;= y2+o2Height)
      collide = true;

   if (x+oWidth &gt;= x2 &amp;&amp; x+oWidth &lt;= x2+o2Width &amp;&amp; y+oHeight &gt;= y2 &amp;&amp; y+oHeight &lt;= y2+o2Height)
      collide = true;

   return collide;
}
</code></pre>
