Ontario police said the man was targeted on a sidewalk between the playing field and parking lot at Colony High School.
No one else was injured, and there was no further threat.
The wounded man was taken to a nearby hospital and listed in serious condition, spokesperson Sequoia Payton said.
An unknown number of suspects fled, and the motive was not known, Payton said.
Police were interviewing witnesses for more information.
The game was not a school-sponsored event, police said.