CSSE 120 Final Python Project—Spring 2007-2008

Disclaimer: This is the second time we have assigned Tetris in Python. Some details may still be vague and subject to change; we'll alert you when they do.

Project Requirements

The final project for the Python part of this course is to implement the game Tetris. Rules for the game are given below.

Your project must satisfy these core requirements:

  1. You must design and implement a fully functional Tetris game including:
    1. moving and rotating pieces
    2. allowing only legal moves
    3. detecting when the game is over
  2. Your project must use a GUI for game play. (We'll provide lots of it, which you will modify.)
  3. You must implement 8 classes, one per piece type plus one for the playing board. You will be required to use an object-oriented design. 
  4. All team members must contribute to and understand their project.

Most of the work on your project will be translating the rules provided into a functional design and implementation. If you are having trouble planning or getting started, get help. It is much better (and easier) to get help early and start off with a good plan than to try to hack a poor design into a semi-functional program in the final days before it is due.

Milestones

To make sure that you are on-track to complete your project, you must meet the following milestones. Each milestone will contribute to your overall project grade. Each milestone must be done before the specified class session.

Grading

Project grades will be based on both individual and group results. We will grade each project milestone, plus the final project program. Grading will include both the proper functioning of your program and an evaluation of your design, coding style, and documentation (including SVN commit messages). The grade will also depend heavily on what enhancements you add (see below).

Each team member will be required to complete an evaluation survey about his or her own performance and that of each of his or her teammates. We will use these surveys and our own observations to assign individual project grades.

About Tetris

Overview

Tetris is a one-player game in which pieces of various shapes fall from the top of the board, one at a time. The player can rotate the falling piece clockwise, move it left or right as it falls, or cause it to drop, until it stops by hitting a stationary piece. Once it does, then a new piece starts to fall. The goal of the game is to position the pieces so that complete rows (lines) are filled with pieces. This causes the row to disappear, the rest of the pieces above it to fall, and points to be scored. Play continues until there are stationary pieces at the top row of the board. The following picture is taken from http://www.freetetris.org/.

There is an interesting discussion of the history of Tetris here.

Rules

Terminology

Piece Types

There are 7 different pieces of various shapes. Note that each has the same area (4 cells).  Pictured are:

The centroid of each piece is marked with a dot. We use this centroid to mark the position of the piece. Also, the pieces rotate around this point (except MrChunky, who dosn't rotate). Note that each piece above is shown in its default orientation, that is, the orientation in which it starts at the top of the playing board.

Initial Game Setup

Game Play

In each time step:

To get a feel for gameplay, please play the version at http://www.freetetris.org/

Suggestions

Enhancements

Once you are done with the basic version, you will be required to add some enhancements. You will earn a higher grade for doing more challenging ones, and the more, the better. Here are some suggestions, to get you thinking.