Flappy Birds tutorial using Phaser and Typescript
Recently I’m looking at writing some simple games for mobiles. After extensive research I’ve settled on using a framework called Phaser – it is actively supported and it uses HTML5’s webgl / canvas – i.e. it falls back to canvas if webgl is not supported on the device. This is great especially given that Windows Phone have just announced support for these elements, with iOS and Android already having them.
I am not going to post the actual tutorial – I followed the excellent Flappy Birds with Phaser tutorial by Jeremy Dowell – a great way to learn Phaser and 2D game programming concepts. I then rewritten the game with Typescript (with a few minor changes). Note that I do not own any of the images, sounds etc., this is sample code and this is a personal project. I’d also like to praise the Phaser team who have accepted all the bugs I’ve logged (minor typescript mapping issues) and fixed them in a matter of hours (wow!).
You will need Visual Studio 2013 Update2 to run this game.
So what do you get?
– Visual Studio editor support (including IntelliSense, F12, Find all References etc.).
– some Visual Studio debugging (you can debug Typescript from VS as well as from the browsers but to be honest game frameworks are highly event driven and debugging screws up the timings so you’ll have to learn to rely on logging)
What’s not great ?
– The typescript mapping are not documented so if you hover over a method you do not get its documentation like you do in C#. I understand this is a hard problem and the Phaser team are looking into it but no progress so far. To workaround this you still have to consult the docs or to manually search into the phaser.js file;
– Slightly longer code – browser cycle because of the extra compilation step and occasional sync issues between VS and the browser
– IIS also introduces some small problems, chief among them security restrictions on certain file formats. The fix is trivial (add a line in your web.config) but
– my implementation still has a few bugs 🙂
The solution is shared via my OneDrive.