I’ve spent part of a day playing with webcam + face tracking + box2d in Flash. The source for the face detection and tracking is from Quasimondo. I used QuickBox2D to get a simple Box2D setup. And the rest is just good old actionscript. It’s the beginnings of a game, and I’ll keep updating the post as I go.
First up is the initial experiment. Keep the ball in the air!
Next up I’ve changed the paddle to move in the opposite direction to the webcam image, which ends up being the same direction that you’re actually moving. I’d initially though that the way it was in the first experiment added to the difficulty but it was counter intuitive and everyone I’d watched give it a go mentioned it. I also smoothed out the rotation movement compared to the first example, and the paddle becomes shorter as you progress. So here’s the second version.
So another day spent on this webcam game and I’ve made a bunch of additions / improvements. I’ve added a calibration section which helps with translating the webcam tracking to the paddle control, as I’d found it was quite difficult to get the paddle to far edges of the screen. Seems to be better control of the paddle now. Also added some of the standard game screens (home, instructions, start, game over, etc). Everything’s just simple placeholders as the moment as I’ll be skinning the UI when all the functionality is done. So try phase three of the game in progress. And if you give it a go leave a comment, I’d like as much feedback as possible.