snakes

Multiplayer "Snake" game using Ruby, MongoDB, WebSockets, and HTML canvas.

Stars
24

Snakes

Built as a learning experiment. Multiplayer "Snake" game using Ruby, WebSockets, and HTML canvas.

Application architecture

The application is divided into two parts, a (1) game server, and a (2) web server.

Data (user names, scores, images, etc) is persisted through MongoDB, with a single user model shared between both the game server and the web server.

Game Server

Snakes.io game server is powered by Reel, a "fast, non-blocking evented web server" built atop Celluloid, a concurrent object framework. Celluloid is probably most well-known for previously powering Sidekiq, an amazing background job processor for Ruby.

The game server runs on JRuby, per Celluloid recommendations.

Web Server

A simple Rails 4 application responsible for serving the website, authentication with Facebook, and asset compilation & management.