A simple, classic clone of the Tetris game built entirely in Java using the Swing library for the GUI. This project is a straightforward example of game loop mechanics, keyboard input, and 2D graphics rendering in Java without any external game engines.
- Classic Tetris gameplay
- All 7 standard Tetromino shapes
- Scoring system based on lines cleared
- Piece rotation and "hard drop"
- Pause and Restart functionality
This project consists of three .java files that must be in the same directory:
- Tetris.java(The main window)
- Board.java(The game logic and panel)
- Piece.java(The Tetromino class)
- 
Compile the code: javac Tetris.java Board.java Piece.java 
- 
Run the game: java Tetris 
- Create a new Java project.
- Add all three .javafiles (Tetris.java,Board.java,Piece.java) to the project'ssrcdirectory.
- Run the Tetris.javafile (it contains themainmethod).
- Left Arrow / A: Move piece left
- Right Arrow / D: Move piece right
- Down Arrow / S: Move piece down (soft drop)
- Up Arrow / W: Rotate piece right
- Spacebar: Drop piece instantly (hard drop)
- P: Pause / Resume game
- R: Restart game (only when game is over)