FORZA 4 (4-in-a-row)
see other Java utilities at:
Yagga's Java pages!

This is a simple socket based game of four in a row (Forza 4 in Italian).

The package includes a multi server, able to handle many games in parallel. The client (standalone or applet) allows the user to start and define a new game or to join an already created one.

The purpose of the game is to play over a LAN with other players to drop your tokens in a grid in order to form a row. Generally you have to put 4 tokens in a row, but this can be configured, as well as for the number of players involved.

Download arkive (91K)
[Zip ]

3611

JDK:
1.1 and above
version:
2.0
date: 23rd October 1999
author:
Walter Gamba
e-commerce:
e-mail ware/shareware
inside Yagga framework: YES

LICENSE
The source code can be used and redistributed, provided you state where you take the code. It cannot be used in commercial projects without asking me before.
This game can be used freely in its server/standalone client (not Applet) configuration. An e-mail with comments/thanks is all I ask.

The APPLET version instead is shareware for commercial sites. If you test it and like it on your site, you are encouraged to register.

Registration fee is 30$, and you can obtain a free customization of the applet with custom colors, logos, graphics and text of your liking.

Commercial sites are sites taht earn money: not people's home page, but sites with ads, paying banner, or .com addresses. Any other site is considered "non-comemrcial" and thus is exempted from the shareware license.


Forza4 is composed of a server and a graphical client and applet.

The game comes with full source code.

The game can be played on a LAN or over the Internet (provided packet can pass firewall and/or proxies). You could try tunneling on port 80....

The game can allow any number of players, and can be configured to be N-in-a-row.

the ZIP contains:

  • forza4.txt (this file)
  • src/ the dir with source code
  • bin/ the dir with the classes, startup scripts, html page and jar

To play with this game you need to:

  1. run the server program
  2. run one or more client programs/applet pages that connects to the above server

The Server

start the server on the server machine:

>java f4.F4Server [-p port] [-n num_of_games] [-v]
or
>server.bat [-p port] [-n num_of_games] [-v]
>server.sh [-p port] [-n num_of_games] [-v]

where

port: is a number greater than 1024, default 9239

num_of_games: is the number of games in parallel, default 10

-v: verbose output, for debugging purpose only, default off

this will put up a server listening on the specified port of the server machine. The server is, by default, able to handle up to 10 games at a given instant. Once a clients logs in, it is able to set up a game deciding how many players will take part in the game, and how many tokens in line will be necessary to win.

The Client

on each client machine start a client:

>java f4.F4Client [-a inetadx] [-p port#] [-v] [-h]
or
>client.bat [-a inetadx] [-p port#] [-v] [-h]
>client.sh [-a inetadx] [-p port#] [-v] [-h]

where

inetadx#: TCP/IP server adx, default localhost

port#: TCP/IP server port number, default 9239

-v: verbose mode on, default off

Once the client is up, first create a new game (from the drop down list, chose <<new game>>, or join an existing one. Then choosea name, and then log in by pushing the "Login" button. At this point, wait for other players to join.

Once other players have joined tha game starts.

The player that must move will see a message "please move", others will see "wait for other palyer move".

To move, simply click with the mouse on a column: if there is a free place a token will be "dropped" in that column. You will see your tokens as red ones, and other players tokens in other colours.

The Applet

The applet looks and behaves more or less as the standalone client. The sample page F4applet.html demonstrates how to include the applet in your page.

The applet has 3 parameters:

server=host.name.com

port=NNNN (default:9239)

verbose = true|false (default false)

The only one needed is the server param: set it to point to the machine where you have set up and running the server.

To install the applet on you site, simply copy this two files

F4Applet.html the html sample page

F4client.jar the compressed java classes for the client/applet

of the "bin" directory on a convenient subdirectory of your site, and then write a link to the F4Applet.html.


 

Hail ErIs and good luck!


Yagga's Java pages are copyright(C) 1999
Walter Gamba

Yagga server and PbML are copyright (C) 1999
of Marco Becchio and Walter Gamba