This package provides the graphical and interaction engine for playing Tetris, an interactive game where the player must position pieces as they fall down a game board to fill the board as densely as possible.

See:
          Description

Packages
OOPI.tetris This package provides the graphical and interaction engine for playing Tetris, an interactive game where the player must position pieces as they fall down a game board to fill the board as densely as possible.
OOPI.tetris.util This package contains utility classes to support tetris.

 

This package provides the graphical and interaction engine for playing Tetris, an interactive game where the player must position pieces as they fall down a game board to fill the board as densely as possible. The rules of the game are that pieces can be rotated or moved left or right as they slowly fall down the board until they hit the bottom, or an already fixed piece at which point they can no longer be moved. Whenever any row is completely filled with piece cells, that row is erased, and rows above are shifted down to fill the gap. Game play continues until there is no room to place the next piece. The game is controlled through the logic specified through the TetrisLogic interface which must be implemented in order for the game to play.

There are two variations of play - manual and automatic:

Manual Play:

A random piece appears at the top of the board, and slowly falls toward the bottom. The delay between pieces slowly decreases. The player can control the active piece through these keys:

Automatic Play:

This is the same as manual play except that the starting position and rotation of a piece is optimized through the piece position quality evaluation function, TetrisLogic.computeMoveQuality(). In addition, the delay between game steps is much less so the game flows very quickly. So, while a player could control the pieces as they fall, in practice there is not time.

For homework #9, you must complete the Tetris class, implementing the following methods: