The puzzle-game

The game shows a grid with letters and a list of words. The player must find every word. Next picture shows the game when started

The player can ask to paint the solution by clicking the Resolve button (see next image).

The player can also restart the game at any moment by clicking the Again button, or ask a new grid by clicking the New button.

The game has three levels: easy, medium and advanced.

Easy level

In easy level, when the player moves the mouse over some word in the list, the game draws a preview line in the grid, as in next picture.

Medium level

In medium level, the game does not draw any preview.

Advanced level

In advanced level, the game hides the list of words to find (see next picture).

The two-player game

The game can run on a network. When started the game asks for a grid to a HTTP server. The player can ask to collaborate with another player through the server. Next picture shows the game waiting for a collaborator (the player can play in meantime).

When another player asks for a collaboration, the server makes the link and sends a new grid to both players (the same of course).

The players can disconnect whenever they want, if they are collaborating the connecion bar, at the bottom of the screen, notifies the other player.

Starting the game

One player:

> cd <swiby-core-dir>/demo/word_puzzle
> jruby -I../../lib puzzle_game.rb

Note:

Two players (using localhost):

> cd <swiby-core-dir>/demo/word_puzzle
> jruby -I../../lib puzzle_game.rb -r&
> jruby -I../../lib puzzle_game.rb -r styles/sea_styles.rb&
> ruby puzzle_server.rb
** Starting server (127.0.0.1:3000)
** Shutting down...

Notes:

  1. The server needs Mongrel HTTP library
  2. The server displays the port it listens to, you can stop with ctl-c
  3. The server does not need Swiby
  4. I was not able to install Mongrel to run it with JRuby, therefore I used the C Ruby

Using another host/port

To change the port use the -h host-name and -p port-numbrt options (for the game applicatios and the server)

> cd <swiby-core-dir>/demo/word_puzzle
> jruby -I../../lib puzzle_game.rb -r -h localhost -p 3030&
> jruby -I../../lib puzzle_game.rb -r -h localhost -p 3030 styles/sea_styles.rb&
> ruby puzzle_server.rb -h localhost -p 3030