Gems allow players to buy extra lives or continue playing after losing all their lives. They can also be exchanged for power-ups and hats.