Assignment Problem Description
Your project will be to implement a basic version of a game like Tetris using Java and JavaFX. Your game will use the Tetris Guideline as a reference. It will not be necessary to implement all aspects of game to achieve a good grade (details below). A basic description of Tetris gameplay is here, and many more details appear below.
The remainder of this document describes the features you will need to implement and a description of some key terminology.
Copyright and Trademark
The name "Tetris" is trademarked by The Tetris Company, who have also placed a copyright on the game. It is entirely clear that you cannot trade your game under the name "tetris". It is a little less clear what it means to copyright the game. The Tetris Company has used the DCMA (which is US law), to shut down tetris clones. However, unless you intend to engage in production and dissemination of technology, devices, or services intended to circumvent measures (commonly known as digital rights management or DRM) that control access to copyrighted works, I think you're fine. This assignment does not ask you to implement Tetris and has none of those objectives.
It is important that whenever you write code, you are aware of the legal context in which you operate.
Deliverables
| Stage | Deliverable | Week | Marks |
|---|---|---|---|
| 1 | Organize groups, assign roles | 2 | 1 |
| 2 | Analysis and design | 4 | 3 |
| 3 | Individual class implementation | 6 | 1 |
| 4 | Individual class and testing | 8 | 4 |
| 5 | Integration demo | 9 | 3 |
| 6 | Final submission (Friday 5pm) | 11 | 15 |
| 7 | Final demo and presentation | 12 | 3 |
Required Features
The marking scheme for the assignment is spelt out alongside the description of each stage of the deliverables. Stage 6 is the main deliverable, and it attracts half of all marks for the assignment. In this stage, in particular, you have an opportunity to differentiate yourselves from other groups.The following describes the elements of the tetris game that you need to implement in order to attain various grades for Stage 6. Note that these are minimal necessary conditions for getting the relevant grades, they are not sufficient conditions. To understand what is required to attain a given grade for Stage 6, you need to see the marking criteria.
- Pass
-
- A single level (with gentle G=1/48 gravity) of the game.
- All of the seven tetrominos are generated.
- The game will consist of a 10 wide, 20 high playfield. (Note that to achieve credit or higher you should make the playfield 22 rows high to accommodate a two-row vanish zone).
- Tetrominos will correctly fall and pile up on the floor of the game.
- Tetrominos will correctly rotate according to keyboard input and the SRS rotation scheme.
- There is no need to implement multiple levels.
- There is no need to implement random tetromino generation.
- There is no need to implement line clearing.
- There is no need to implement lock delay.
- There is no need to implement a vanish zone.
- There is no need to implement any wall kicks.
- There is no need to implement hard or soft drops, just normal G=1/48 gravity.
- There is no need to implement a scoring system.
- There is no need to implement an auto repeat system.
- Credit
-
- All of the Pass-level criteria, plus the following...
- Randomly generated tetrominos fall.
- The game will correctly implement line clearing with naive gravity.
- The game will correctly implement the vanish zone using rows 21 and 22.
- The game should implement a scoring system (your choice).
- Distinction
-
- All of the Credit-level criteria, plus the following...
- The game will correctly implement recursive gravity.
- The game will correctly implement the guideline compatible scoring system. (Update 13/9/12: You are not required to impement elements of the scoring system for t-spins or for features that are not required at the Distinction level, i.e. soft and hard drops. Implementing these features counts towards High Distinction).
- The game will
execute with a "frame rate" of 60 frames per seconduse 1/60 of a second as the basic quantum of time. This refers to the underlying speed of the gameplay (which determines the rate at which blocks fall, etc), not the refresh rate of JavaFX . If you find this confusing, refer to lectures 11 and 12 where the same issue arose. The caterpillar moves at a given speed (pixels per second), regardless of the rate at which JavaFX redraws the screen. (Updated 26/9/12)
- High Distinction
-
- All of the Distinction-level criteria, plus the following...
- The game will implement more than one level, with increasing gravity.
- The game will implement piece preview.
- The game will implement some selection of other features of the indispensable rules, such as wall kicks, hard and/or soft drops, an auto repeat system, etc.
Resources
- The Tetris Wiki
- For the sake of this project, you should consider the Tetrisconcept wiki to be the definitive reference.
- The Tetris Guideline
- The Tetris Guideline is the official reference for the game. However, it is not publicly available. However, key elements of the guideline have been established and these are known as the indispensable rules. Your version of tetris will be based on these rules.
Definitions
The following are definitions of standard terms used to describe tetris. For more information, see the tetrisconcept wiki.- Delayed Auto Shift (DAS)
- DAS is a scheme for allowing a piece to move repeatedly if a key is held down.
- Drop
- Drop describes the downward movement of each tetromino. There are three categories of drop: gravity, soft drop, and hard drop. You are only required to implement gravity, which is the automatic downward movement of the tetromino. A basic implementation need only implement gravity of G=1/48.
- Frame
- A frame is the basic quantum of time in a game like tetris. Most tetris games, including the one you should implement for this assignment, run at 60 frames per second.
- Indispensable Rules
- The indispensible rules are key rules that are believed to be core to the Tetris Guideline because they are observed by authentic Tetris games. This assignment is based on these rules, though not all need be implemented.
- Line Clear
- Line clearing describes what happens when a block falls to the point of hitting an obstruction, and as a result, a complete row of fallen minos is formed. The completed row disappears and blocks above move down.
- Lock Delay
- Lock delay is a delay between when a tetromino falls to the ground and when rotation becomes no longer possible.
- Mino
- A mino is a square block, the basic element from which tetrominos are composed. Each mino is the size of one grid element in the playfield.
- Navive Gravity
- Naive gravity is the counterpart to recursive gravity. It describes the way blocks move after a line clear occurs. With naive gravity, blocks move simplisitically downward, which may result in floating blocks.
- Piece Preview
- Piece preview provides a preview of the next tetromino to fall into the playfield.
- Playfield
- The playfield is the grid in which tetrominos fall. In our game we will use a playfield 10 columns wide and 22 rows high. Tetrinimos enter the game in rows 21 and 22, both of which are hidden, and known as the vanish zone.
- Random Generator
- The so-called "random generator" is a scheme for generating randomized selections of tetrominoos. The key property is that while the ordering is randomized, there is never a long gap between tetromino of each type falling. The random generator does this by generating randomized orderings of the tetrominos, seven at a time.
- Recursive Gravity
- Recursive gravity is the counterpart to naive gravity. It describes the way blocks move after a line clear occurs. With recursive gravity, blocks move in a more intelligent way, which avoids the anomoly of floating blocks.
- Scoring
- There are a variety of scoring systems for Tetris. For high marks, you should try to implement the guideline compatible scoring system.
- SRS Rotation
- The Super Rotation System is a set of rules that describe exactly what happens when each of the tetrominos is rotated, and in what state they are spawned.
- Teromino
- There are seven tetrominos, each composed of a different arrangement of four minos: I, J, L, O, S, T, and Z, each with its own shape, rotation rules, and color. You should use the JavaFX colors: DEEPSKYBLUE, ROYALBLUE, DARKORANGE, GOLD, LIMEGREEN, DARKORCHID, and RED.
- Vanish Zone
- In our game, rows 21 and 22 of the playfield are not visible, and are referred to as the vanish zone. All tetrominos start (spawn) in the vanish zone before falling in to the visible part of the playfield.
- Wall Kicks
- A wall kick moves ('kicks') a tetromino into a usable space if a rotation would otherwise result in the tetromino clashing with an occupied space.
