From the Super Mario Wiki
The Goomba thumping game is a special minigame run by a Mole entrepreneur from Moleville. It is found in the Pipe Vault level of Super Mario RPG: Legend of the Seven Stars. To find it the player needs to enter the second to last pipe in the area with many pipes. The Mole charges contestants ten coins to play the game, and if the contestant can reach a certain number of points, the Mole will give the contestant a special prize. Such prizes include Flower Tabs, Flower Jars, and Frog Coins.
In the game, Mario must jump on as many Goombas as he can in a thirty second time limit. The Goombas emerge from four pipes located in the small game room. For each Goomba Mario thumps, he will be awarded one point. However, Spikeys also emerge from the pipes, and if Mario jumps on one, he will lose one point. Rare Gold Goombas also emerge, and if Mario is fast enough, he can earn three points by stomping one. Since Gold Goombas move faster, Mario has less time to hit them. Additionally, the more points Mario earns, the faster all enemies become, making higher scores difficult to achieve.
If Mario can achieve the goal established by the Mole entrepreneur, he wins a prize. The first target is 20 points. Every goal after that is always two more points higher than Mario's current high score.
There are two strategies to achieve high scores in the Goomba thumping game. The first strategy is for Mario to stand in the middle of the four pipes. As Goombas emerge, Mario can jump to one pipe then return to the middle then jump to another pipe and return to the middle, etc. Another strategy is for Mario to stand on top of one pipe and jump every time a Goomba emerges.