This is an old Anime comedy trope, probably in western animation as well.
Are you in your front yard and hear someone yelling FORE!! ?
Congratulations, you're in a town contest episode and will soon begin to learn how to play golf. That is, after you get hit by that golfball of course. Everyone in town will either participate or join the audience, depending on how athletic they are. Expect your friends to be wearing a sports uniform during the entire episode. The prankster, the bad guy and the bungling inventor will not miss this opportunity to somehow rig the game.
The contest will always start with a fireworks shot, followed by a crowd shot and depending on how much time there is still left for this episode, a couple of shots of minor contestants before moving on to the main characters wishing each other good luck.
Either the main character wins, or a muggle/nobody will win the game when the amount of cheating reaches ridiculous heights.
- Candy Candy has a rodeo contest.
- Cardcaptor Sakura did a town scavenger hunt.
- Kirby of the Stars does this quite a lot, sometimes with absurd fads sweeping the town.
- Every other episode of Pokémon features the cast coming across some town in the middle of a themed Pokemon competition like flying, skateboarding, cooking, dancing, etc.
- Wowser has a town contest every three episodes.
- Eureka does this often with scientific contests, such as the "build your own dog" contest.
- The Play-by-Post Game Journey Through the Multiverse has this as its third world, with a town in Tibet holding a contest to see who can catch the most ghosts, with a winner receiving a chest. However, things don't end well, and the contest was just to see who'd be a good meal for the monster inside the chest.
- Alfred J. Kwak featured a town-wide triathlon.
- Angelina Ballerina did this in the 2002 series episode "Treasure Tandems". Angelina and the other mouselings embark on a treasure hunt/scavenger hunt in teams of two on bicycles.
- The Loud House episode "Racing Hearts" focuses on Luna and Sam competing in a town scavenger hunt