What I Learned From Making a Flappy Clone




So after seeing Team Talima and Unity Tech make Flappy Bird clones on Twitch, I wanted to try to make one for myself. I realize that it's already 2017 and Flappy Bird is no longer all the rage. However, it's simple enough to make in one day and it's an interesting learning opportunity. 

Resources


I watched this tutorial by Unity. It is a recording of a live training session that was broadcast on Twitch. I want to make it clear though that I did not follow this tutorial step by step. Instead, I watched it leisurely, as in it played in the background while I was performing other tasks. I later challenged myself to get most of the programming done in one hour without consulting the tutorial.

I think this is definitely an interesting way to follow a tutorial. Sometimes when following tutorials step by step it's easy to lose sight of why certain things were done. So if you're trying to learn Unity, I would definitely recommend trying to replicate what a tutorial teaches without consulting the tutorial itself. Then, afterwards, review the tutorial again to fix things that were implemented poorly.

My piano teacher always used to tell me, "practice make permanent." So while making a lot of bad games is the way to level up your skills, always take the time to learn how to do things right.

Building For iOS 


This one was driving me to crazy town. I so desperately wanted to build a game to iOS and have it playable on my iPad. The problem is that iOS is not an easy operating system to create a build for. It is nothing like building for Windows or Android. Apple has got development for iOS locked down and it is virtually impossible to do so without a Mac. 

What about Unity cloud build? Yeah, sure. You can go that route. You just have to apply to be an Apple developer and hand them a Benjamin. Except, it's not that easy. In order to even set up your account and generate required signing keys, you must have a Mac.

So as a non-mac owner I... I bought a Mac. Yep, that's right, I went to the dark side. It's okay, I really needed a new laptop anyways. I got an older MacBook Pro (2012) on the cheap from the electronicBay. I then picked up a nice Samsung SSD and inserted an 8GB ram stick I had lying around. So now, I have a decent portable dev machine. Most importantly though, I can now build for iPad with ease! :D

Anyways, the way building to iOS with Unity works is that it exports a native X-Code project. You then have to open the project inside X-Code and from there it can be compiled and sent to a device for testing. It's not all that difficult and I'm excited to learn about building for this platform.

Saving High Scores


Sometimes it's important to just be aware of what the tools you are working with are capable of doing. When it comes to saving high scores locally, Unity has a surprisingly simple system for doing just that. They're called PlayerPrefs. This is simply a way to create, set and get variables that persist across scene transitions and play sessions.

In this project, the code that deals with saving scores looks like this:

What's Next


Again, this is just a simple and silly project for learning purposes. I intend to keep jamming on game prototypes in order to gain more experience in developing with Unity and I want to share what I learn with others. If you're trying to learn Unity or you're interested in rapid prototyping for games check out my GitHub repo. I wrote a ReadMe that describes and organizes information about making a game every week and I am going to commit most of my projects there, including the source for this Flappy clone.

Thanks for reading. :)