When an Auckland dad had trouble sleeping one night in July, instead of getting up for a glass of water, reading, or watching TV, he built an app.
About two hours later, when James Brown's 2-year-old daughter Mina woke up, the app - a game called wOmp - was working.
And importantly, it was fun, the 34-year-old said.
The game went up on Apple's App Store last Thursday and has since been featured on the home page's "best new games" section.
It was downloaded 4333 times on the first day and by Saturday, the number of downloads had increased to 12,790.
As of last night, 21,491 people had downloaded the game.
"It was completely unexpected."
Mr Brown, who grew up in New Plymouth and studied film at the University of Auckland, said he spent the last couple of months perfecting the game so that it was endlessly variable, but also challenging and rewarding.
Mr Brown said wOmp was a "physics puzzle" with gravity fields as obstacles. It is somewhat reminiscent of a pinball machine. The game is free to download.
Mr Brown's day job is as a film- maker and editor. His series of Red White Black and Blue documentaries follows a team of teenage rugby players from a charter school in south-central Los Angeles as they tour through New Zealand, China, the United Kingdom and France.