Skip to content

tina-hague/Tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

28 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TETRIS ๐ŸŸฅ๐ŸŸง๐ŸŸจ๐ŸŸฉ๐ŸŸฆ๐ŸŸชโฌœ

Project Description:

This game is played in the terminal and is meant to mimic the original Tetris game created in 1985 by Russian software engineer Alexey Pajitnov. After playing the board game pentomino in his office, Alexey Pajitnov decided to create a version of it virtually, which became a popular game on the original GameBoy. My recreation of the game is not complete yet and the only way for the game to end is by quitting or losing.

<! . . . . . . . . . .!>
<! . . . . . . . . . .!>  
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
<! . . . . . . . . . .!>
  \/\/\/\/\/\/\/\/\/\/

๐Ÿ”Ž Features:

There is a grid composed of characters that represent the boundaries of the game and the shapes that are manipulated. A block is represented by "[]". The following shapes may be found in the game.

   []               [][]      []     [][]    []     
   []     [][]      [][]      []     [][]    []          [][]
 [][]     [][]                []             [][]      [][]
                              []

Future implementations aim to calculate a score based on the number of lines filled and then clear them.

๐Ÿ’ป Code:

All shapes have predetermined coordinate positions in the grid. The T, S, Z, L, J, I, and O shapes are all subclasses of the Shape class. The Board class is static and utilizes the Shape class by randomly generating T,S, Z, L, J, I, and O shapes and manipulating the one that is actively falling. The game uses exception handling and analyzes the input provided by the user to ensure smooth gameplay.

Classes:

Click on the image to view the UML Diagram Draw.io file

๐ŸŽฎ How to Play:

You can download the zip file or clone this repository and run it in VSCode, or another compiler or IDE. When running the code, please make sure that you have selected Main.java as the main class. A random shape is generated and placed at the top of the grid when the previous shape has fallen to the bottom. You will be prompted to move the actively falling shape with the following moves:

l -> left   (move the shape left by one block)
r -> right  (move the shape right by one block)
s -> shoot down   (drop the shape to the bottom)
q -> quit   (exit the game)

The game currently only ends when the user quits or when the game is lost (a new shape can not fit in the board).

// TODO: remove commented code // TODO: update UML Diagram and attach it to the repo // TODO: check all comments and delete unnecessary print statements // TODO: check that all criteria in the rubric have been met // TODO: check if the clearFullLines() method works by having Ari test the game

About

A form of Tetris that is played in the terminal and is meant to mimic the original

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages