My Own Flappy Bird


Like most people, I think, I was curious about Flappy Bird when I read about the success that the developer had with it but more importantly, the $50,000 a day that he was reportedly making from it.  I downloaded the app and played with it for a bit and got a bit frustrated trying to get a 1 for a score and so deleted it.  I don’t have time to master this nonsense.

Then I read that Flappy Bird was going to be pulled from the application stores, never to return.  I figured that this was either an indication that he’d made a gazillion dollars and just didn’t want to support it going forward.  After all, nothing succeeds like success.  Score 1 for me, Brandon.  The other option was that this was some ploy to get a lot of downloads in a hurry.  I figured that I’d help the cause.  I might never play it again but at least I’d have a little bit of history.  So, I downloaded it again.  Add two downloads to the big total for me.

Bored one afternoon, I figured it was about time that I mastered it.  I got up to 3.  Grrrr.  When I read that a friend of mine’s daughter had a pretty good score, I realized that I just wasn’t cut out for flapping.

On the UK Microsoft blog, there was a post to promote the UK Hour of Code.  It was titled “All in a Flap – How to create your very own Flappy Bird clone (Guest Post)”.  Now, there were warnings that people were posting malware in their own clones of Flappy Bird but here was the opportunity to write your own.  I wondered…

  • how would this play out for the classroom?
  • here was a chance to do something significant with Microsoft’s TouchDevelop code

The next step was predictable.  I sat down to work my way through the tutorial to see what I could do.

The tutorial was laid out in the form of a series of challenges.  Note the stars below.  Each is awarded at the end of the completion of a step.  Off I went.

greatjob

The development environment, with overlaid tutorial, is interesting.  Everything is designed to be tapped on to insert or edit your code as you go.  For this ol’ coder, the urge to use my keyboard was there.  However, I quickly boxed myself into a corner – the tutorial really was written for touch – so I gave in.  After a while, you just get used to it!  It’s not bad once you get the knack of it.  I did want to make my game a little different so instead of the suggested bat, I decided to flap with an orange.   It just didn’t cut it so I did go back and edit out the orange and replaced it with the bat.  The results made much more sense!

board

All along the way, there is a dialog to explain what would be done next.  You’re really stepping through the code development nicely.  Nothing is given to you – you have to add and edit everything.  I will admit to getting a bit frustrated but got over it in a hurry.  Once I decided to go with the mouse clicks to do the selection and editing, development moved along fairly nicely.  The only new challenge was when the desired action was on the next page of instructions.  Again, I got over that with a little patience.

The ongoing tutorial really did explain things nicely.  That will make it definitely easier to go back and modify the code afterwards.

instructions

When you’re done, it’s interesting to take a look at the code.  Having paid attention to the tutorial as I went along definitely made it easier to go back and modify the script to see what I could do to break a well put together program.   Selecting a line of code gets you back to the editing instructions.  The only thing missing was creating your own comments inline.

code

As you can see, I went with a desert theme.

desert

You’re prompted as you go to log in to save your code.  That’s always good advice.  It also gives you the ability to publish your code as an application from the web.

All in all, it was an interesting activity.  I started with the end in mind and just kept going.  Once completed, the real fun was in going through the code to see how it was developed and then modify it for my own fun and enjoyment.

You can’t beat writing your own game where you make your own rules and make things easy enough to get a high score.  I think I’m at 5.

A TouchDevelop Tip


Lately, Alfred Thompson (@alfredtwo) has been sharing a great deal about his experiences with TouchDevelop.  His latest post is actually a story around a video showing how to use Turtle Graphic in TouchDevelop.  That did it.  If anyone can program and create a video at the same time, I’ve got to give it a shot.

Of course, you need an idea.  So, in tribute to Alfred’s Tip Calculator presentation at the CSTA Conference last summer, I thought I’d write a little tip program, all the while learning the language and user interface.

I head on over to the TouchDevelop site where you log in with your Microsoft, Facebook, or Google account.  I log in with my live.ca account and I’m ready to explore.  I took a look at one other program and decided to just forage ahead.  Kids, don’t do this at home.  I had no planning, no layout, (quite frankly no idea of what the syntax of the language was going to be…).

When you create your first script, you actually don’t get plopped into a blank workspace unless you want…

scripts

There’s going to be lots to explore in the future.  For my simple program, I have no need for any bells or whistles…

blank

Hopefully, I can change that!

Within a few minutes, I had learned enough of the environment and the language to create a first program.

touchdevelop

And run it, I did…

Photo 2013-06-11 7 58 13 AM

Wait a minute.  Careful observers will note that I created the program in Windows but ran it on my iPad!

Therein lies the excitement of this application.  It’s not just a development tool for the desktop.  Because it’s all online and carefully crafted, it will run on many devices!

Photo 2013-06-11 10 28 52 AM

Whoops.  OK, just about anything.  Looks like Google Chrome for the iPad isn’t on the list!

But it certainly worked well on my Android Phone.

Screenshot_2013-06-11-08-12-51

In fact, the nice clean interface seems to play well just about anywhere.

But, writing and running on your device is only part of the story.  There is an option to compile and share your work.

export

I don’t have a Windows Phone or Windows 8 but I certainly do have devices that could run the HTML 5 WebApplication.  Even running it locally is interesting when you view the source and see all that’s going on to make it work.

If I’m a Computer Science teacher, I would be very excited to see this land in my classroom.  It’s web based so you’re already accessing the latest, greatest version.  It works on a variety of devices so BYOD is a real possibility.  Students don’t need the school computers; they could be coding on their own device both at home and at school.  What’s not to like?

I would encourage anyone who is interested in coding at any level to take a look at TouchDevelop to see if it has a home in your classroom.  I’m betting that it well.

In addition to your own work, make sure that you explore the home page for TouchDevelop to see the showcase applications that are being development.  There’s some amazing things and if the author allows you, you can grab a copy of her/his code and make it uniquely yours.

A printed manual and free to download manuals are available here.  Finally, stay in touch on Facebook!