Arduino Pong

I was inspired by this post to create my own implementation of Pong with my newly acquired Arduino. Though NTSC isn't really my thing, so I made use of this awesome TV out library:

http://code.google.com/p/arduino-tvout/

It comes complete with fun intro screen with a "ball" that slowly eats away at the title (spoiler alert: it doesn't ever eat the whole thing, it checkerboards it as you might expect if you think hard about the mechanics of it) and a "Game Over" screen. Here are some more little tidbits:

  • The game plays to a score of 7 right now because I didn't feel like implementing multi-digit scores.
  • There's no color at all (just black and white). I have no idea how to make it color, since I don't know anything about how the TV interface works.
  • It can be played using one "controller" or two. I only had one potentiometer at the time, so it's configured for one controller that controls both paddles. But having two controllers should work just fine. Just alter the WHEEL_TWO_PIN setting.
  • Paddle sizes are configurable if you want to mess with that.
  • Most of the #defines can be tinkered with to alter the game experience except for "LEFT" and "RIGHT" which are used exclusively for scoring, so just ignore those.
  • There's a very simple hardware setup. I found that only a couple resistors (a 1K and 330) were required for both TVs I tested on.
    Supposedly, with minor modification, the game should work on PAL TVs. But I haven't tried it and small parts of my code are resolution-dependent, so your mileage may vary.

If you don't care to build your own, you can just check out a video here:

(note that I added the "eats away at the title" feature after making the video, so just use your imagination there).

You can see a picture of my hardware setup, along with complete source code, here:

Imgur

I'm very new to Arduino programming (only been doing in a couple weeks), so be gentle when it comes to commenting on my hardware.