30 Jan 2014

The conversation that sparked this one went something like this:
Me: Are you playing Flappy Bird? I can’t believe everyone’s stuck playing that. It’s so simple. I get why it’s addicting, but dang it’s so simple. I could probably make it in 20 minutes.
Friend: Dammit. Died again. 20 minutes though? No way. It’s simple, but it’s not that simple.
Me: Fine. You’re right. 25 minutes.
Friend: Bet you can’t.
Me: Today, after school, at robotics. You’ll time me. From the moment I’ve got the dev environment set up until I’ve got it deployed to my phone. 25 minutes.
Friend: Deal.
In the end my friend was right. Flappy Block took 25 minutes and 34 seconds. This is how that went.
The Challenge: Design a Flappy Bird clone for iOS and Android in 25 minutes. Results? Challenge accepts. Challenge accomplished.
I’d just started playing around with Adobe Air a couple days prior, so I figured the best way to do this was with Actionscript 3. It made sense for a few reasons. First, the game was simple enough that I didn’t have to worry about the performance loss from using Flash. Second, I had 25 minutes to make a game and Flash’s display list and ActionScript’s characteristic syntax made getting up and running a very quick task. On top of that, I was deploying to my iPhone and didn’t have a Mac on hand, so XCode was out and my only other option under the time constraints would’ve been to do it as a web app. Plus, and don’t tell Apple this, I don’t actually have a developer certificate, and I already had FlashDevelop set up to deploy to a jailbroken iPhone with some fake certs, so I wouldn’t have to waste time figuring that out. And just like that, I set out to work.
It only took 25 minutes, so there isn’t really much to say. If you’ve played Flappy Bird, you know how simple it is, and my rendition was ever so slightly simpler. The hardest part was creating a simple way of endlessly generating the level, which I did with a Pillar object (consisting of the upper and lower barriers with a standardized distance in between them) that I could just continuously add to the stage (and then delete when it left the screen) at a random height within a certain interval. After that, the most time consuming part involved tweaking speeds, accelerations-due-to-gravity, and all other associated variables, and then everything was done. Clean and simple and quick. Not pretty, I’ll fully admit to that. But still kind of cool. And impressive within the time constraints. Without further ado, here’s all the information about that.
The Basics:
Name: Flappy Block (code-base calls it Flappy Ball, but I changed it to a block to get the hittest code finished in the 25 minutes)
Language: ActionScript 3, iOS and Android capable with Adobe Air.
Source: Here. It’s missing the certs in the /cert/ folder, but otherwise has all the necessary code.
Tools: FlashDevelop. An iPhone timer.
The Game:
You can find the links to the iOS and Android version of the game here: .apk.ipa. Both are actual game files. The .apk should install on any Android device, though you might need to allow installing-via-download in your settings. The .ipa, again, isn’t officially certified, so you’ll need AppSync on a jailbroken iPhone, or some other way of installing apps directly via IPA (pretty sure iFunBox has an installer for jailbroken devices, though I can’t say I’ve ever used it). Even though it’s a Flash game, the .swf doesn’t work well on a computer since all of the controls are by touch. If you’ve got a touch-screen computer, you might be able to get it working by downloading that .swf and running it from your desktop. Good luck and happy flapping.