Real-time Silverlight Tic-Tac-Toe Game

January 10, 2011

Real-time TicTacToe in Silverlight

Real-time TicTacToe in Silverlight


http://www.silversmalltalk.com

Above is an image of a real-time Tic-Tac-Toe online game being played in two separate browsers.

The game took about an hour to develop – this time will get shorter as the tools and libraries improve.

To play, open the “DemoBrowser” from the desktop context menu. Or evaluate:

TicTacToWindow openOn: ‘X’ channel: ‘my-channel’

Change ‘X’ to ‘O’ if needed; ‘my-channel’ should be a unique name for your game – all players in the game need to be on the same channel.

TicTacToeWindow uses the “Channel” class to send game state (as a Smalltalk Dictionary) to other players in real-time. The backend communications is handled by the ChannelAPI service of Google’s Application Engine and should be highly scalable.

The TicTacToeWindow class can be viewed in the ClassBrowser:
Object->DependencyObject->UIElement->FrameworkElement->UserControl->UserWindow->Window->GridWindow->TicTacToeWindow.

This is a pretty simple game, but it provides a good foundation for more complex board games like checkers, chess, GO, etc.

There will be more games, “social network” widgets, and business collaboration tools uploaded over the next week.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: