collision(s)


    
    function detectCollisions(){
      //just reflect the ball on a collision
      //a more robust engine could change trajectory of ball based
      //on where the ball hits the paddle
      if(collisionX())
        dx = dx * -1;
      if(collisionY())
        dy = dy * -1;
    }