The other month, I set myself a little challenge: Write a simple Flash game within two hours. The result was The Touch Type Tester. I know it wasn’t exactly a world beater, but hey-ho it was a bit of fun and blimey what did you expect in that sort of time?

Anyway, last week I thought I’d have another go, so I set myself the same challenge. I scratched my head for a while and thought Tetris would be fairly simple. After all, Tetris isn’t a million miles from The Touch Type Tester… is it? They’re both just falling shapes, right? Well, kinda…

Yeah, so that was the first mistake.

I didn’t really think this through before starting, so it took somewhat longer than the two hour target. Doh!

I’d quickly set about making my Tetris style shapes fall sexily down the screen. But then I started to think more about how the blocks actually needed to interact with each other and it became a teeny bit more complicated than it first looked. Then I realised another flaw, stopping blocks from going out of bounds when they’re rotated – suddenly it wasn’t a case of dealing with what was currently on screen, it was also about stopping stuff that might happen.

After much faffing… here’s the result. I know it ain’t pretty (the code certainly isn’t!), but w-h-a-t-e-v-e-r… it works (mostly)!

Click “New Game?” to begin and the arrow keys to control the blocks:

Left = Move block left
Right = Move block right
Up = Rotate block
Down = Make block fall faster

You’ll have to let me know how long you survived level 10!

Comments on: "Flash Game: Tetris" (2)

  1. I’m dead impressed with this, well done you. Still waiting to see what you do with that nifty little platform engine thing you started. I think there is a certain rope climbing cowboy just crying out for your new hot flash gaming skills.

  2. Why thank you.

    Funnily enough, I was intending to do some stuff on that platform engine last week, but kinda got carried away when Tetris ended up taking longer than I thought!

Leave a comment for: "Flash Game: Tetris"

Blogalism - Movie reviews and general geekiness.