Pong in HTML5 Canvas and YUI3, with tests!

In case you’re one of my clients, you might be wondering why I’ve been slacking off recently. Here’s why: I’ve been teaching myself ‘grown up’ JavaScript under instruction of Douglas Crockford (in book and video form, obviously). Crockford never mentions Test Driven Development, probably because he doesn’t do it. But I do, so I’ve been learning to do that in JavaScript too.

So here it is, HTML5 Canvas Pong.

Pong is effectively a Hello, World! application for game developers. It’s not particularly fun, and my version is full of amusing bugs. It’s currently single-player only, and mouse-driven. There’s also no scoring or any game over: the ball just keeps travelling off-screen.

By the time you read this, however, all of these bugs could be fixed, and it could have amazing features you never thought possible in a computer game, let alone in a browser. But I doubt it. You can follow its progress over on Github.

My intention is to write a well-tested, JSLinted 2D game library for JavaScript that I can understand. Yes, I know someone else has probably done it. Humour me.

I was inspired by Chris Lowis’ version.

7 thoughts on “Pong in HTML5 Canvas and YUI3, with tests!”

Comments are closed.