Piggybacking on the social-media giant, Twitter, Twittleships allows Twitter users to play games of the classic board game Battleships against one another. The use of Comet means the game can be fast paced as each player's screen updates in real time.
On joining the game, each player is placed in a queue and play the next available opponent. Users can, if they wish, play multiple simultaneous games. Like the traditional version, a player wins when they've sunk their opponent's entire fleet of ships or when their opponent forfeits the game. In an attempt to prevent cheating, in my version a player will also win when their opponent has failed to play their move in a given length of time. Users recieve audio and visual cues as to when it is their turn to play.
Players join the game via the OAuth authorisation system which authenticates their credentials against Twitter's servers. I used a popular open-source Node.js OAuth module to acheive this which I subsequently modified to achieve the results I wanted. If players opt to give Twittleships permission to "tweet" on their behalf, Twittleships tweets on the user's timeline when they sign up for the game to promote the game. Users can also optionally tweet announcements that they have beaten opponents. Periodically, Twittleships' own twitter account, @twittleships, will tweet league tables for the same reason.
Like most other projects listed here, Twittleships is hosted on a Virtual Private Server (VPS) that I own and manage. To get around problems of port managment, all requests are proxied through Nginx directly to Node.js which serves the dynamic content. Nginx also serves the static content, without proxying, via a sub-domain.
Play Twittleships now!