title: How do I have a collision and reaction between two classes?
body: <p>I have an array of type Dot which carries a Point and radius and a Player which is a rectangle with a Point and size.</p>
  
  <p>I would to create a method which is constantly testing if the Player touches/collides with any of the dots in the array. Where would i write the code and what do i need to pass in as parameters? </p>
  
  <p>This is for a game where the player must dodge dots. So far i have something like this.</p>
  
  <pre><code>for (int i = 0; i &lt; NUM_DOTS; i++) {
     if (player.intersects(dotPos[i])) {
        gameOver = true;
     }
  }
  </code></pre>