Tetris

A Tetris game as a Java applet, requiring Java 1.2 or later.

Overview

This is a rewrite in Java of the game tetris, a puzzle game invented by a Russian programmer Alexey Pajitnov. A complete overview of the game can be found on Wikipedia. This implementation runs with Java 1.2 and later.

Keys binding

Scoring

The scoring formula is explained in details on Wikipedia's tetris page. I use that formula in this implementation. In short, the more simultaneous lines are removed, the more points are scored. However, if you leave the preview on, you will only get half as much points.

In normal gravity mode, bonus points are rewarded for any additional full lines removed as a result of hanging blocks falling down. In addition to the normal points granted for those additional full lines, a bonus of (lines x 1000) is added to the total score, where lines is the number of lines removed.

Levels and speed

At level zero, tetrominoes are dropped one square per second. The drop interval is reduced by 15% at each superior level. So that at level one, tetrominoes are dropped one square per 0.85 second, and one per 0.72 second at level 2, so on and so forth. There is no limit for the levels. However the drop interval will never go below 60ms, which is reached at level 17.

Gravity

The original tetris had a hanging gravity model, that is, after full lines are removed, a free block would hang above empty spaces underneath it. In this implementation of tetris, a normal gravity model is offered as well, in which hanging blocks would fall and cause further full lines to be removed. Uncheck "Hanging gravity" to activate the normal gravity model.

Last updated: 2006-02-27 00:25:43 -0800