Over the last couple of days I’ve been spending a little bit of time playing around with (and getting really excited about) HTML5 Canvases.

Canvases let you define an area on a web page onto which you can draw on using Javascript. You are pretty much free to do what you want in this area, right down to drawing individual pixels.

This has got me rather excited…

A long time ago…

When I was at school my IT life was monochrome and 640K of RAM seemed like an unimaginable amount of memory, I used to write games. I probably should have been doing my homework, but missing a few assignments doesn’t seem to have done my career any harm.

I’d hack away and then once a week me and my friends would all get together at the then offices of Daily Information, and we’d show them off at the computer club they’d hold there.

Life was simpler back then; we didn’t need fancy 3d graphics or photo realistic scenery (Wolf3D and RotT were then state of the art). The bar was set low enough that spotty teenagers could hack together playable games in a weekend.

Going back to my roots…

A central theme of our little hacks was the maze game. These were simple in concept, but there was a lot you could do with them. Over time as our experience in the craft grew, these maze games increased in sophistication – containing traps, soundtracks and even AI monsters – but still held true to the same basic template.

Ever since then, every time I’d learn a new language or build software for a new platform, one of the first things I’d do is write one of these simple maze games.

They were a simple “known problem”, but required you to use most of the key concepts you’d likely need – input/output, files, loops etc – and made for a much more interesting “hello world” program.

I must have written the same basic game a hundred times (I even wrote one for the Psion Workabout), and in keeping with this tradition, here’s one I wrote for HTML5 canvas/Javascript the other afternoon.

It’s not anywhere near the level of sophistication I’ve done before, but it has got me excited about the possibility of hacking some fun little games together. I think I may have to go through some of my old disks, and see if there’s some code from those days that deserve a new lease on life…

Aww… I’ve gone all sentimental.

3 thoughts on “Playing with HTML5 Canvas

Leave a Reply