title: iOS Pong Development, Collision Detection
body: <p>I am in a late phase of finishing my first usable iOS app.
  I am creating a simple Pong game i am using a simple collision detection using <code>CGRectIntersectsRect</code>, but i came up with a problem.</p>
  
  <pre><code>if(CGRectIntersectsRect(mic.frame,plosina_a.frame)) {
          if(mic.center.y &lt; (plosina_a.center.y + plosina_a.frame.size.height)) {
              RychlostMice.y = -RychlostMice.y;
          }
      }
      if(CGRectIntersectsRect(mic.frame,plosina_b.frame)) {
          if(mic.center.y &lt; (plosina_b.center.y + plosina_b.frame.size.height)) {
              RychlostMice.y = -RychlostMice.y;
          }
      }
  </code></pre>
  
  <p>When i use it like this the ball (mic) sort of gets to the paddles (plosina) and starts moving the other way sort of in the middle of the paddle.
  My programming teacher managed to fix this problem for one of the paddles (the _b one) by adding the .frame.size.height instead of just .frame which i have used before, but when i did the same thing for the other paddle it didn't work i don't know what's up with that.</p>
  
  <p>Also it creates another problem sometimes there is a situation where the ball get's caught up in the paddle - so I'm looking for a definition of the whole object and not just one side probably?</p>
  
  <p>i hope you can help.</p>