Pong!

pongscreenshot.jpg

Leif and I are now able to play Pong over the Internet. It’s not perhaps the best example of the venerable video game, but the paddles do move nicely up and down as we twist the potentiometers that are attached to our XPort boards.

Rather than use the text-based network commands in Processing, we decided to go one step out into regular Java using Sockets with InputStreams. This approach was pretty easy, and seems to add a lot of flexibility.

If we have more time this week, our Processing code will get some improvements. The key issues, as far as network communications go are:

  • Oddly, the range of bytes transmitted by the XPort goes from 0 to 255, then back to 0 to 25. This is now fixed. We found a simple error in averaging
  • Our connections sometimes drop out after a bit. Some code to check for that and reconnect would help stability
  • Creating controller objects would make managing upgrades–like feedback to the controllers–much easier.

Of course, the other major improvement is to finish the Pong game, adding things like ball movement on the Y axis, and immersive 3D graphics….

Scroll to Top