[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]
Koloris is a simple tetris like game, which lets fall pieces one after the other onto a playfield. The pieces consist of blocks of different types, represented either by different colors or by different shapes. The objective is to place and rotate the pieces such that three blocks of the same type lie next to each other in a row, column, or diagonal. If such a chunk is created, it disappears and the user gets one point. The blocks which were on top of the chunk (if any) fall down to the next free position (which may result in disappearance of additional chunks and so on).
Depending on the dimensions of the display, the pieces move either from top to bottom or from right to left. In the first case, the user can move the piece by using the left and right cursor keys and can rotate the sequence of types in the currently moving piece by using the up cursor key. The down key lets the piece fall down as far as possible. In the second case the piece is moved with the up and down keys, rotated with right and "slammed" with the left key.
Koloris may be run as an application, as an applet or as an MIDlet to be used with Nokia phones capable of executing Java-MIDlets. There are two jar-Files, one which contains the application and applet-classes and one for the MIDlet version. The MIDlet may also need the descriptor-file. The application was only tested using JDK 1.3, the applet using Netscape Navigator 4.6 and the appletviewer of the JDK mentioned. The MIDlet was tested using the Emulator provided by Nokia, but I would be very pleased to hear from people successfully testing it on their mobile phone.
Koloris is free software, distributed under the GPL (GNU Public License). The sourcecode consists of five files, where the applet/application needs only KolorisApp.java and KolorisField.java and the MIDlet consists of KolorisMIDlet.java, KolorisCanvas.java, KolorisField.java and GameScores.java.
The applet/application do not show highscores at the moment because it is difficult to obtain a generic long term storage solution for an applet. The MIDlet uses the RecordStore mechanism in order to save highscores.
One objective of the Koloris development was to create classes which are as small as possible, because mobile phones do not have as much memory available at the moment. Since the java compiler stores the names of all members in the classfile even if they are private to the class or to the package, one strategy could be to give the private members very short names. As a result of this the code would become partially unreadable, thus the best solution is to include a precompiler step, which renames all private members. This is exactly what the Smallifier does. In the present version it is very rudimentary, but it works with the present sourcecode.
A good solution to those problems would be a complete redesign of the Smallifier on top of a compiler compiler, for instance the JavaCC. This would help a lot in finding all identifiers and could also make other optimizations possible, for instance replacements of constants or automatic inlining. If someone is interested to do this, I would very much appreciate this ;-)