Java Tetris
I really like Tetris and I searched the net for
a good Java implementation of the original PC
game made by Pajitnov, Pavlovsky, and Gerasimov
back in eighties. I played Java on Sinclair ZX
Spectrum, Commodore Amiga, PC (DOS/Win versions),
Atari ST, Dreamcast and on big arcades and none
of these was good as the original game (although
the Spectrum version was pretty addictive).
So, I made a simple Java 1.1. applet implementation
which should resemble the original.
The applet link is here:
http://home.earthlink.net/~mihailod/jt/JT.html
It's finished although it could be improved.
I would appreciate any comments/suggestions!
[715 byte] By [
mihailod] at [2007-9-27 18:06:28]

Good job, it's good. The only thing I can think of right now is that the keys seem a bit awkward. Maybe it's just me, but if it was using the left, right arrows and down to drop the piece and maybe spacebar to rotate it, it would be better. Of course that's an opinion. Otherwise, I liked it.
TETRIS! OOH! Nice. However, I should lecture you for making an extremely addictive game :P
I agree with Ceranith. The keys are all wrong.Rotate with 5, move left with 4, right with 6.2 should drop.Your pieces need more texture also- g.fillRect() just looks amateurish.
> Rotate with 5, move left with 4, right with 6.
You should consider using the numeric keyboard
(7-8-9 over there have the same layout as 4-5-6,
they are only one row above :) ) I remember the
original version (at least for DOS and in Europe)
using 7-8-9-space so you could play with one hand.
> 2 should drop.
I am considering this in the "patch" version 1.0.1.
> Your pieces need more texture also- g.fillRect() just
> looks amateurish.
Maybe. But the original Tetris had solid fills.
Sorry to reply so late in the day but I have only just stumbled across your Tetris implementation. I was immediately addicted and ended up playing until the small hours of the morning. I found the key mappings were easy to get to grips with, so I won't complain as the others have.
The main problem that I had was speed. Obviously, as you make progress, the game speeds up. However, the speed never seems to get reset back to its sedate pace at the beginning of the game. So the net effect was that the better I did, the faster and faster the speed became at the beginning of the game, when you restart. This made it depressingly impossible to beat my previous scores. At least, that's my excuse anyway ;-)
Other than that, good job.
> > Rotate with 5, move left with 4, right with 6.> ...key setup should be configurable, of course you will have to reset it everytime you launch the game since it's an applet. Another option is to make 4 or 5 possible key configurations which make everybody happy...
jpw35 at 2007-7-6 14:23:48 >

> > Rotate with 5, move left with 4, right with 6.
>
> You should consider using the numeric keyboard
> (7-8-9 over there have the same layout as 4-5-6,
> they are only one row above :) ) I remember the
> original version (at least for DOS and in Europe)
> using 7-8-9-space so you could play with one hand.
>
> > 2 should drop.
>
> I am considering this in the "patch" version 1.0.1.
>
> > Your pieces need more texture also- g.fillRect()
> just
> > looks amateurish.
>
> Maybe. But the original Tetris had solid fills.
Don't ask for comments ifyou won't hear.
> > > Your pieces need more texture also- g.fillRect()
> > > just looks amateurish.
> > Maybe. But the original Tetris had solid fills.
> Don't ask for comments ifyou won't hear.
just because he didn't* take* the adivice doesn't mean he didn't *listen* to it
I am here and listening :)
Yeah, there is a small bug with the speed. The workaround is to move the speed back *before* starting a new game (during the game, speed can go up but not down for obvious reasons :))
I might release a new version with configurable keys and some more bug fixes. Also, the applet is not intended to be restarted, it should behave as a "real game."
There's a bug in the current row removal algorithm. Well at least it behaves different then any other Tetris implementation that I've seen, so maybe it's a feature.
As the active shape drops, the row completion check is made on each and every row, even before the active shape settles.
Theoretically, if the entire screen were filled, except one column, dropping the "four red squares in a straight line" shape down that column would clear the entire board, rather then just the last four rows.
arick at 2007-7-6 14:23:48 >

Hm... I could not reproduce this. I rechecked the algorithm and also tried to make several test cases (with a tall 1-gap and 1x4 element and with a tall 2-gap and 2x2 element etc...) but everything works as it's supposed to (i.e. like in the original Tetris.) The lines are not dissapearing as the piece goes down (that's how I understood you.)
Thanks for the report, I am not saying there are no bugs but maybe I still did not understand you?