Welcome to the Tetris Game implemented in Java using Swing! This project is a classic Tetris game with a graphical interface, showcasing the use of Java for creating interactive and visually appealing games.
- Classic Tetris Gameplay: Enjoy the timeless Tetris game mechanics.
- Intuitive Controls: Use the arrow keys to move and rotate the Tetris blocks.
- Score Tracking: Keep track of your score as you clear rows.
- Colorful Blocks: Each block has a distinct color for easy identification.
- Game Over Screen: Displays your final score when the game ends.
To run the Tetris game on your local machine, follow these steps:
-
Clone the Repository:
git clone https://github.com/ayu-ano/tetris-game.git cd tetris-game
-
Compile the Code:
javac StartTetrisGame.java
-
Run the Game:
java StartTetrisGame
- Start the Game: Launch the game using the instructions above.
- Controls:
- Right Arrow: Move block right
- Left Arrow: Move block left
- Up Arrow: Rotate block
- Down Arrow: Drop block
TetrisBlock.java
: Defines the Tetris block properties and behaviors.GameSource.java
: Contains the main game logic and panel for rendering the game.StartTetrisGame.java
: Entry point to start the Tetris game.
Include some screenshots to give users a visual representation of the game: