C# Brickbreaker game, get brick to dissapear when hit
<p>I have an array for the x co-ordinate of the bricks, an array for the y co-ordinates of the bricks and an array to show weather it is visible. My code reads like this:</p>

<pre><code>            if (Visible[0] == 1)
            {
                paper.DrawRectangle(pen, BrickX[0], BrickY[0], 50, 10);
            }
</code></pre>

<p>and for my collision for the ball to hit the brick, the code reads:</p>

<pre><code>        if (Visible[0] == 1)
        {
            if ((x &gt;= BrickX[0]) &amp;&amp; (x &lt;= BrickX[0] + 50))
            {

                if ((y &gt;= picDisplayBat.Height - 190) &amp;&amp; (y &lt;= BrickY[0] + 10))
                    yChange = -yChange;
                    Visible[0] = 0;
</code></pre>

<p>This does not seem to work as when the ball comes close the brick, the brick dissapears before the collision has happened and the ball goes straight through it. any suggestions? </p>
