Touch Tone Tanks

Use your phone keypad to control tanks online
18 Jul 2012
Paul Kernfeld dot com

Only two players, but you get the idea.

Touch Tone Tanks was a 24-hour hack that I worked on with David Trejo and Justin Ardini for HackNY Fall 2010, at which we won second place.

Presenting for 800 people at New York Tech Meetup

The Game

The game itself is loaded in a browser window visible to all players. Players use their personal phones to call a specified number, and each phone’s keypad functions as a game controller for an onscreen tank avatar. Because people bring their own controllers, the game supports up to 26 players, although things get confusing after about 10. The game works with smartphones, dumb phones, Google Voice, and land lines, although we never quite figured out how to play on the CS Department fax machine. I built the gameplay and the graphics.

The Technology

The game itself is written using node.js on the back end and Javascript on the front end, using the HTML5 canvas for rendering. We use Twilio to capture the users’ keypresses and send them back to our server, where node.js relays them to the front end via web sockets. The total latency when using this method is usually less than 500ms, although land lines are often faster and smartphones are sometimes slower. All of the game logic is done on the front end so information about the game state doesn’t ever need to be sent to the server.