Detecting a ball collision