Stardew Valley has two minigames, both of which are accessed from the arcade machines at the Saloon. Beating either game will result in you getting your very own arcade machine to play them any time you want. To exit either game, press Escape or the corresponding button on your controller.
Journey of the Prairie King
This minigame is available whenever the saloon is open. The first level can also be played during one of the friendship events. If you beat the game, you can continue to play in Hard Mode until you run out of lives. See here for more details.
To unlock Junimo Kart, you will need the Skull Key from the bottom of the mines. The kart will move forward automatically. Your only control is left-clicking to make the kart jump. The duration of the click determines the height of the jump. Holes and rail stops will cause you to lose a life if you do not jump over them. Progress Mode has six levels to complete. When you finish a level, your lives will refill and the speed will increase. If you lose all your lives, you will be returned to the first level. Endless Mode has no flat areas between levels, so you can keep your rhythm up.