title: Xcode CGRect Collision With multiple CGRects?
body: <p>I have created a game where I have a floor made of multiple images varying in heights.. (So the floor isn't flat)
  Rather then opening a million if statements:</p>
  
  <p>if (CGRectIntersectsRect(ball1.frame, floor1.frame)) {
  }</p>
  
  <p>if (CGRectIntersectsRect(ball1.frame, floor2.frame)) {
  }</p>
  
  <p>if (CGRectIntersectsRect(ball1.frame, floor3.frame)) {
  }</p>
  
  <p>if (CGRectIntersectsRect(ball1.frame, floor4.frame)) {
  }</p>
  
  <p>//and so on...</p>
  
  <p>.</p>
  
  <p>Is there a way I can check collision using 1 if statement? All of the UIImageView floor pieces are named, "floor1, floor2, floor3, floor4, and so on"</p>
  
  <p>Thanks!</p>
  
  <p>Side note:
  If I want to use the CGRectIntersect code and I rotate the image I'm checking the intersection for it seems to still only check the collision for the image frame, so wether I rotate it or not it collides in the same spot. Can I rotate the frame as well to fix this or do I need to use different code, if so what code?</p>