The Lotto Machine - A Random Number Generator with Physics!

The Lotto Machine was a project I started on a whim in October 2008; it was one of my first ever test projects for the iOS SDK and as such was a mess of code and hastily-Photoshopped UI. It created a series of ‘balls’, randomized their locations every second, and then chose 7 of them to show at the bottom. It looked awful, though I thought the idea would have been fun. I shelved it, and forgot about it until three years later.

Fast forward to 2011, and I had just started prototyping projects in Cocos2D, with Box2D physics - the usual physics-sandbox style games. One day while reminiscing over shelved or aborted projects, I came across my lottery number generator app. A lightbulb flashed on in my head: this prototype was missing a physics engine!

It didn’t take long before I’d integrated Cocos2D and Box2D into my lottery project, and suddenly I had an app. The Box2D physics engine was key - without it, the app could not exist. There were countless random number generators on the store, but none looked and felt anything like this. I thought I was on to something…

I spared no time in commissioning an awesome artist to turn my crummy prototype into something gorgeous, and as a result ended up with the stunning UI seen in The Lotto Machine. The balls bounce around the drum as you hold the button, and as soon as you let go a series of numbers will pop out of the chute and roll across the shelf. If you move your device about, the accelerometer will also affect the balls and give you a sense of control over the random selection. Not only is it fun to use, but it’s kinda addictive. Just between my first couple of prerelease users the drum was spun 676 times in just three days!

The Lotto Machine is available now from the App Store if you'd like to check it out. Let us know if you win anything with it!