A console-based Tetris game implemented in Java, featuring various shapes and rotations. The game supports score tracking and row removal upon filling.
- Multiple Tetris shapes with rotation functionality.
- Row removal when a row is completely filled.
- Score tracking.
- Basic collision detection to ensure valid placements.
- Clone the repository:
git clone https://github.com/yourusername/tetrisgame.git
- Navigate to the project directory:
cd tetrisgame - Compile the Java files:
javac -d bin src/brick_game/*.java - Run the game:
java -cp bin brick_game.Main
- Start the game and enter the size of the board.
- Players will be prompted to enter the shape number, number of rotations, and the starting column index for each shape placement.
- The game will validate each move, check for row completions, and update the board accordingly.
- The game continues until there is no space left to place a shape.
- Input shapes by specifying the shape number, number of rotations, and the starting column index.
- Coordinates are in the range of 0-7, corresponding to the columns of the board.
Enter row size: 10
Enter column size: 10
enter shape no: 1
enter no of rotations: 0
enter starting column index: 4
Score: 0
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | |#|#| | | | | |
| | | |#|#| | | | | |
enter shape no: 2
enter no of rotations: 1
enter starting column index: 0
Score: 0
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
|#| | | | | | | | | |
|#| | | | | | | | | |
|#| | |#|#| | | | | |
|#| | |#|#| | | | | |