It might be testicular torsion. This is where the blood supply to the testicle is twisted and shuts off. You would need to seek immediate medical care to prevent losing both the use of the testicle and necrosis.
If you notice a distinct bulging, and it seems to hurt more after eating, you may have a hernia. A portion of intestine has broken through the abdominal wall, and is pressing down on the testicle. Although not as dangerous as testicular torsion, it is still best to get it fixed, to prevent the intestine form getting damaged, especially if you play sports.
his ligament could have snapped