title: Make Images intersect and gravity in VB
body: <p>I basically have a bunch of black boxes and I want the player (PictureBox1) to have gravity, fall, and hit the boxes so they have to jump over them .... I have basic motion of everything, just th "physics" that I need to code. </p>
  
  <p>The Code below is running on a timer, so that it is always pushing the player down by 8, and if it intersects with a block, it starts to push the other way .... </p>
  
  <p>I grouped all the "Blocks" with Blocks(49) = Picturebox .. then individually doing Blocks(1)= Pictuebox1 , Blocks(2) = Picturebox2. So on... </p>
  
  <pre><code> PictureBox1.Top += 8
  
      For x As Integer = 1 To 1
  
          If PictureBox1.Bounds.IntersectsWith(floor(x).Bounds) And floor(x).Visible = True Then
              standing = True
              PictureBox1.Top -= 1
          End If
      Next x
  
      For y As Integer = 1 To 49
          If PictureBox1.Bounds.IntersectsWith(blocks(y).Bounds) And blocks(y).Visible = True Then
              standing = True
              PictureBox1.Top -= 1
          End If
  
      Next y
  </code></pre>