"At the beginning, life and death is every week, and then you have longer cycles," says Riccardo Zacconi, chief executive of Britain's most valuable games company, the $5bn (£2.9bn) King Digital Entertainment. He is talking about the rollercoaster that has been King's decade-long ride to the top.

Zacconi, 47, sports the tech entrepreneur's regulation casualwear, with a dash of Italian style. He is dressed top to toe in navy blue, with matching polo shirt, jeans and trainers. The office around him vibrates with the explosion-in-a-paint factory colours of King's hit smartphone game, Candy Crush.

At the end of an orange-and-white striped corridor is a staff cafeteria with panoramic views of London's West End, where the Nespresso machine hums next to an ostentatious array of coffee capsules, and a beautician applies the finishing touches to an employee's Friday night makeup.

More people play King games each month than live in the US, and the company is currently in expansion mode. In a few weeks, it will open a second London studio, taking over Facebook's recently vacated British headquarters in Covent Garden.

But the free caffeine and makeovers are a far cry from the company's early days. Back in 2003, a year after launch, the money had run out. Zacconi had been living rent-free in a friend's spare room, working without a salary. It was just before Christmas, and he was flying home to Italy later that day. He and his co-founder Toby Rowland, son of the late mining tycoon and Observer newspaper proprietor Tiny Rowland, were staring at the fax machine, willing it to come to life.

"We had a promise from one of our angels [early backers] to invest in the company, but the piece of paper was not signed," recalls Zacconi. "We wanted to make sure we could pay all our creditors, and to do that we would have had to shut down the company that day."

At the last minute the fax arrived, only for the machine to break down mid-transmission. But King lived to fight another day.

The angel investor was King's chairman, a low-profile, Derby-based businessman called Mel Morris, who at the age of 58 has little in common with the hipsters in silicon roundabout, but just happens to be one of Britain's most successful technology entrepreneurs. Morris built uDate, where Zacconi briefly worked, into the world's second largest online matchmaker before selling it in 2002. He is now King's biggest private investor, holding shares worth $580m.

"Riccardo understands people," says Morris. "His charisma, integrity, sense of fair play and abundant humility allow him to gently lead from the front. Many entrepreneurs fail because they are so single-minded they struggle to scale their business beyond their own limitations. Riccardo succeeds because he allows his management to share the challenges and rewards."

The hardest moment for King came in 2009. Rowland, who was co-chief executive, had left to work on other ventures and Zacconi was in sole charge. King.com was profitable, with revenues of $60m a year from desktop games. But its business was built on attracting traffic from the big internet portals such as Yahoo, and their days were numbered.

"The hardest moment was when Facebook was the place to be and we were not there," says Zacconi. "The only way to manage a period of transition like that is to be 100% open and transparent with your employees."

So he gathered the staff and showed them an illustration by the cartoonist Mordillo. A holidaying couple are relaxing on a beach under a parasol. But the beach is in an hourglass and the sand is rapidly draining from beneath them.

There followed a tense 18 months, when the company raced to develop a game that would appeal to Facebook users before its portal traffic dried up. Morris advised halting development for Yahoo, and splitting the spare staff into teams of three, each testing different formats.

In September 2011 Bubble Witch Saga, where players line up three or more spheres of the same colour to pop them, launched on Facebook. By the end of that year, revenues from mobile and social games had outstripped those from older desktop formats. The transition to mobile was easier, with the Bubble Witch Saga app published in July 2012. But the big break came in November 2012, when Candy Crush, another match three game, made its appearance on mobile. By the end of that year, King was pulling in $160m annually. By 2013, revenues were $1.9bn, with small payments for extra lives or sweetie-shaped ammunition on Candy Crush accounting for the vast majority of that income.

Christian Hernandez Gallardo, who helped build Facebook in Europe and now invests in startups through White Star Capital, has described Zacconi as one of the "good guys" of the technology business, saying: "This is not an overnight success, or an 18 month exit. It is over a decade of building and rebuilding a business, of adapting to trends and technologies, of being humble but hungry."

Now King is having another Mordillo moment. The markets have given the company a rough ride since its March initial public offering on the New York Stock Exchange, discounting the valuation by $2bn. Despite a slight rise in the most recent quarter, revenues are down from their peak last Autumn. The concern is that King cannot repeat its success with Candy Crush, which is beginning to slip down the download charts.

"Our strategy is not based on building another hit game like Candy Crush," says Zacconi. "It was a mega hit. Our strategy is to build a portfolio of games." He wants players looking for games in enduring genres, like trivia, hidden object, or word puzzles, to pick King's version because they trust the quality.

Wall Street is hammering other digital stocks – Facebook has dipped, and Twitter has lost half its value this year. Are we witnessing another technology bubble bursting?

"I don't think it's a bubble, there are real fundamentals behind these companies: revenues, profits and reach," says Zacconi. "The companies now are very different to 1999."

As his business vocabulary suggests, Zacconi trained as a management consultant with the blue chip firm Boston Consulting. He went on to learn the lessons of the dotcom crash the hard way, building up a European internet portal called Spray. The float planned for 2000 was abandoned, and the company sold up to another portal, Lycos Europe.

But the purchase was made entirely in Lycos shares, with no cash element. By 2001, those shares were almost worthless, and Lycos was laying off hundreds of people.

"We took care of every employee," says Zacconi. "We made sure everyone had a job somewhere. That was good because when I started this company what we did was to call up all our former employees, and they were very friendly."

Zacconi reunited his best people, including chief creative officer Sebastian Knutsson, who now runs the firm's Stockholm studios, the crucible from which King's most successful games have emerged.

Zacconi applauds the government's decision this year to grant tax breaks to games produced in the UK, an extension of the film credits that have attracted dozens of Hollywood productions to Britain. "This new incentive for the games industry is great," he says, "because I believe from the UK you can conquer the world."

King's key statistics

352 million people play one of its games every month

97 million people a day play Candy Crush

1.4bn games played every day

Candy Crush accounts for 67% of money spent by players

The company has three titles among the top 10 grossing games on Apple's App Store, Google Play and Facebook