The game you are describing is likely Temple Run. It features endless running, obstacle avoidance, and collectible items in an ancient setting.