Video of me coding Breakout in Flixel in 20 mins

Having spent the past couple of days deep in Microsoft Word writing tech specs, I was desperate to do some coding. But I only had a 1 hour lunch break available. So I picked a game: Breakout (Atari 2600 style), found a reference screen shot online to get the colours from, fired-up FlashDevelop, hit record and started coding.

20mins later and it was done. I then hastily cut this video together and uploaded to YouTube (which ironically took longer than coding did). Here’s the video embedded. I sped it up x2 for sanity sake, and it’s a nice way of hiding my typos :) If you can please watch it in HD on the YouTube site, it’s much easier to see what I’m coding!

Watch on YouTube

Ok so it’s not a gaming master-piece, but there’s a real solid shell of a game here you are free to take and expand as you wish. The first thing you may want to do is drop the “cheat wall” from the bottom, add some lives, a score and level progression :)

Full source code after the jump.

This is for Flixel v2.5. Create a new Project that is 640×480 at 60fps, with a black background. My thanks to Adam for clarifying some new 2.5 nuances before I started this :)


I know my blog removes all the extra line spaces from the code. So grab it from here too.

Posted on April 15th 2011 at 6:13 pm by .
View more posts in Flixel. Follow responses via the RSS 2.0 feed.

10 Responses

Leave a comment
  • April 15th 2011 at 7:15 pm

    Cool, was fun to watch! 😀

  • Philippe
    April 15th 2011 at 9:03 pm

    Really shows Flixel’s superpowers!

  • John
    April 15th 2011 at 9:22 pm

    I just watched this whilst listening to the soundtrack to “limitless”. Kinda worked actually.

  • April 15th 2011 at 10:26 pm

    I ported it to iOS in another 20 minutes :)

  • Ali N.
    April 16th 2011 at 11:32 am

    I’m really in love with this Lib, now :)

    Big Thx :)

  • Vini
    April 17th 2011 at 1:35 pm

    I tried to run the source code, but my Flixel do not have the FlxG.collide() method, I am using the patched version of Flixel 2.5 that comes in the Flixel Power Tools.
    Is this version of Flixel already outdated?

  • April 28th 2011 at 1:00 pm

    Very nice! I want to see more of this videos. The real stuff, how a programmer work!

  • May 1st 2011 at 3:22 am

    I also want to see more videos! A 24 marathon will be nice 😀

  • ZenoArrow
    October 1st 2013 at 11:51 am


    Thank you for this blog post, it was really useful to me. I followed most of what you were doing in the code, except for one function. This bit…

    public function Breakout() {}

    Why was the empty Breakout function required/used?


Make yourself heard