A Goal class requires a simple rectangle area. When the ball’s coordinates enter that rectangle and the team matches the correct side, you increment the score, reset the ball to the center, and play a "cheer" sound (using javax.sound.sampled ).
Leo's hand hovered over the 'Y' key. Outside, the rain had stopped. The sun was rising over the campus. He had a presentation in four hours. He could unplug it, show the original, boring version, get a B+, and graduate. java football game
> new rule: fair play