Monday 2 March 2015

Tetris with Javascript

Lately I've been learning a bit of Javascript and trying to put it into practice. The problem always seems to be coming up with an interesting way of using something new. So I decided it was time to write my first Javascript game and Tetris was the obvious choice.

It's amazing how something so small and simple can remind you how much you enjoy programming. It took less than a day and I managed to get a basic implementation of Tetris up and running. Simple problem solving and logical thinking but so much fun! I used an HTML canvas and 5 javascripts files / classes and hey presto, Tetris.

I've got a long way to go before I can call myself Javascript proficient. I'm finding it a challenge to adapt to a dynamic language after so many years of C# and I'm definitely still wrapping my head around Prototypal Inheritance. But if I keep having this much fun, I should be there in no time.

If you want to have a quick play of the game you can go here and if you want to look at the code you can go here.