JAJI - Just Another Javatris Implementation.
Copyright (C) 2005  Denis Nelubin aka Gelin

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

http://gelin.ru
mailto:java@gelin.ru


1. What it is.

JAJI - Just Another Javatris Implementation.
Javatris - Java implementation of the Tetris game.
Tetris - the good old game.


2. How to run.

Type in command line:
    java -jar Javatris.jar
or
    java -cp Javatris.jar ru.gelin.games.javatris.launch.Application

You need installed Java Runtime Environment (JRE) v.1.4.2 or later. You can
download latest version of JRE and JDK from official Java site http://java.sun.com.

It's needed that java executable placed in directory included into PATH
system environment variable.

If you installed JRE correctly it's may be possible to run program just with
double clicking to Javatris.jar file.

You can use provided javatris.bat (javatris.sh for UNIXes) file for easier run
this application.

To run as applet use included javatris.html.


3. How to play.

You have a glass. Blocks of different shapes fall down into your glass
sequentially. You can rotate block, move it left and right, drop it to the
bottom of glass.

If blocks are placed so that one or more horizontal line is filled without
holes, this lines disappear freeing space for new blocks. So the main goal
of the game is to put more blocks into glass, i.e. removes maximum filled
lines.

More lines disappeared, more scores you get, blocks fall faster.

Keys are:
left arrow  - move block left,
right arrow - move block right,
up arrow    - rotate block,
down arrow  - drop block to the bottom of glass.


4. How to build.

You need Java Development Kit (JDK) v.1.4.2 or later and Apache Ant v.1.6
or later to build this project.

You can get latest version of JDK from official Java site http://java.sun.com.
You can get latest version of Ant from http://ant.apache.org.

JDK must be correctly installed. But generally it's enough to set JAVA_HOME
environment variable to directory where JDK is installed.

Ant must be placed into 'tool/ant' directory of this project (it's enough to
copy only 'bin' and 'lib' directories). Or you can provide any other location
of Ant in ANT_HOME variable in build.bat.

Launch build.bat to build project (compile source files and create jar archive).
For more information about build targets run build_help.bat.

Linux notes:
Use build.sh and build_help.sh instead of .bat.
Debian GNU/Linux does not provide Sun's SDK, it uses free implementations of Java
compilers and libraries such as Jikes and Classpath.
In Debian you must set JAVA_HOME to /usr/lib/fjsdk to use free Java.
build.sh tries to detect is your SDK free or not, it uses another build file for
free SDK.


5. Troubleshooting.

Trouble:
Application starts and terminates slowly. There are below messages in console:
WARNING: Not exists node '/ru/gelin/games/javatris/records' in system preference tree.
WARNING: Can't create node '/ru/gelin/games/javatris/records' in system preference tree.
Decision:
Check access rights to system preferences (see documentation for java.util.prefs.Preferences).
For Sun's SDK 1.4 and 1.5:
In Windows you must have write access to register key HKLM/Software/JavaSoft/Prefs.
In Linux you must have write access to directory $JRE_HOME/.systemPrefs, where $JRE_HOME is path to
you current Java Runtime Environment (not JDK home!).
