Coding game: catching coins and avoiding bombs

As I tried to explain, when something hits the ship (an item from class Ball I suppose) distinguish whether it was a bomb or a coin:

if(isCoin) 
   score++; 
     else 
  health--;

Show your entire code so we can take a look.