Nodejs and Physics

I was going to make a my first project in nodejs a simple airhockey game. It was going to be an opportunity to not just play with nodejs, but also HTMLS5's canvas tag and websockets. I got the canvas and websockets portion working, and even talking to a nodejs server (more on this stuff in a later post series.)

There was a hang-up halfway through the airhockey project. I found myself having to recreate a physics engine. While this sounds like an interesting project, it wasn't where I was hoping to go with the project I was working on. Instead, I set off on a search for a nodejs-based physics engine. No such luck.

Then I stumbled upon Box2d2. There is already a Javascript physics engine! It seems mainly built for browser use, but it's already written. So my new meta-project is to port Box2d2 into a nodejs module. A side-meta-project is to learn how to properly unit test nodejs modules and applications.

box2dnode is available at http://github.com/jadell/box2dnode.

No comments:

Post a Comment