http://qs1969.pair.com?node_id=144413

100% served in perl.

Warning, it is rendered in SVG and requires javascript & uses frames. NS and IE do fine with it on windows. Not sure if it works on NS6.X, or Mac OS.

What it is:

It's a nettrek-inspired prototype of a 2-player game (a currently non-shooting version of tank battle) that demonstrates browser-browser interaction without special software (I am using SVG but this could be dhtml too).

How you play...

Two people on 2 PCs can play this game: Each person goes to the game starting page, and one person starts player 1, sends the passkey to player 2, and waits for player 2 to start.

Player 2 starts. Uses the key passed on to register into the game session, and gets going. (caution: There is no error-catching for typos on the keys right now)

The game: click here

The concept:

Each invocation of the game writes a set of lockfiles (1 per browser,hence the passkey) on the server, which stores the last command uttered by either side through a cgi-based GUI (the think that kind of looks like a tank on the top-left window).

When client browser is launched, a single frameset is generated showing the tanks. The frameset contains two frames:

  1. the visible SVG-rendered game
  2. a hidden frame containing some control javascript.

The hidden frame refreshes every 30 seconds, and is a perl-driven cgi which reads the content of each lock file and transmits the commands back to the frameset. The visible frame has access capability to the hidden frame and reads the changed values, giving changes in motion of the vehcles and their gun turrets.

The source code is available here (zipped format).

As I said above, this is a prototype. Please don't forget that :)

A single person can test this by themeselves by first taking the role of player 1 and initiating a session, and then taking the role of player 2 and joining the game. NB: The player-2 control window opens exactly above the payer 1 control window.

hackmare.