public void collision(CollisionEvent e) {
      if (e.getType()==CollisionEvent.TYPE_TARGET && e.getSource()!=null) {
         if (e.getSource() instanceof Bullet) {
            // The collision has really been caused by a bullet!
            Bullet bullet=(Bullet) e.getSource();
            Plant plant=(Plant) e.getObject();
            plant.destroy();
            bullet.disable();
         }
      }
   }