Temple Run has become an insanely popular gaming app, amassing more than 170 million downloads since launching in 2011.

But Imangi, the startup behind Temple Run, launched eight other games in the App Store before achieving great success.

One of those games was called Max Adventure.

"It was kind of an epic failure," Imangi co-founder Keith Shepherd told Business Insider in a recent interview. "It wasn't a success commercially or critically."

That's because Max Adventure is more of a "gamer's game," Shepherd says.

But that "epic failure" was one of the things that led to Temple Run.

After realizing that Max Adventure just didn't work very well on the iOS platform because of its on-screen joystick controls, Shepherd and the Imangi team started thinking of other, better ways to control the character.

At the same time, Shepherd says endless runner games were really popular at the time. But since most of them were in 2D, the team had to come up with an easier way to navigate in a 3D world.

Enter swipe and tilt.

"That's really kind of where it all started to gel with us," Shepherd says.

Now, Imangi is onto its next adventure: Temple Run 2.

Temple Run 2 features a whole new world with mine carts and zip lines.

In the first 24 hours of its release, it quickly shot up to the top of the App Store charts. Within its first four days of availability, more than 20 million people downloaded the app.

“The response from fans has been overwhelming,” Shepherd said in a press release. “We are thrilled players want more of the Temple Run universe, and we hope to grow and expand the game over the coming months.”