- Keyboard Controls: Move and rotate Tetris blocks using arrow keys.
- Game Over Handling: Detects when the game ends and allows restarting.
- Score Tracking: Keeps track of the player's score and cleared lines.
- Level Progression: Increases difficulty as the player clears more lines.
- Text-Based Rendering: Uses the Lanterna library for terminal-based graphics.
- MVC Architecture: Clean separation of concerns with Model-View-Controller design.
- Dynamic Piece Generation: Randomly generates Tetris pieces for gameplay.
- Line Clearing: Automatically removes full lines and updates the score.
- ControllerTest: Verifies input handling (e.g., arrow keys, game restart) and ensures the view is updated correctly.
- ModelTest: Tests for game logic, including piece movement, line clearing, scoring, and game state.
- ViewTest: Ensures the display is updated correctly based on the model's state, including rendering pieces and game over messages.
- TetrisTest: Verifies the successful initialization of all core Tetris game components (Screen, Model, View, and Controller).
- Java: JDK 21 or newer.
- Maven: For dependency management and building the project.
- Lanterna: Terminal-based rendering library.
- Clone the repository:
git clone https://github.com/Akineyshen/TetrisLanterna.git
- Navigate to the project directory:
cd TetrisLanterna
- Build the project using Maven:
mvn clean install
- Navigate to the target Folder:
Open the target folder.
- Run the game:
Right-click on the file Tetris-Lanterna.jar. Select Run from the context menu.
TetrisLanterna/
├── src/ # Source code
│ ├── main/
│ │ ├── java/
│ │ │ ├── controller/ # Controller logic
│ │ │ ├── model/ # Game logic and data
│ │ │ ├── view/ # Rendering logic
│ │ │ └── Tetris.java # Main entry point
│ │ └── resources/ # Game resources
│ └── test/ # Unit tests
├── .gitignore # Ignored files
├── pom.xml # Maven configuration
└── README.md # Project description