Welcome to the Text-based Tetris project! This project is a simple implementation of the classic Tetris game using Java and JavaFX for the user interface, along with JUnit5 and TestFX for testing. The game is designed to run in an Eclipse IDE environment.
This project is a text-based version of the classic Tetris game. It showcases the use of Java for game logic, JavaFX for the graphical interface, and JUnit5 with TestFX for testing purposes. The game provides a simple yet engaging experience, demonstrating fundamental game development and testing principles.
- Classic Tetris gameplay
- Text-based interface using JavaFX
- Keyboard controls for moving and rotating tetrominoes
- Scoring system
- Unit tests using JUnit5
- UI tests using TestFX
- Java Development Kit (JDK) 11 or higher
- Eclipse IDE
- JavaFX SDK
- JUnit5
- TestFX
Follow these steps to set up the project in Eclipse:
-
Clone the Repository:
git clone https://github.com/Team14-SE-Tetris/Tetris.git
-
Import the Project into Eclipse:
- Open Eclipse IDE.
- Go to
File > Import > Existing Projects into Workspace. - Select the cloned repository folder and click
Finish.
-
Add JavaFX to Your Project:
-
Run the Game:
- In Eclipse, locate the
StartMenuclass in thesrcdirectory. - Right-click on the
StartMenuclass and selectRun As > Java Application.
- In Eclipse, locate the
-
Gameplay Instructions:
- Use the arrow keys to move and rotate the tetrominoes.
- Complete lines to score points.
- The game ends when the tetrominoes stack up to the top of the screen.
-
Run Unit Tests:
- In Eclipse, right-click on the
testdirectory and selectRun As > JUnit Test.
- In Eclipse, right-click on the
-
Run UI Tests:
- Ensure your tests are located in the
testdirectory and follow the TestFX framework. - Right-click on the test class and select
Run As > JUnit Test.
- Ensure your tests are located in the
Contributions are welcome! If you have any ideas or improvements, feel free to fork the repository and submit a pull request. Please ensure your changes are well-documented and tested.
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy playing Tetris and happy coding!
https://www.notion.so/add4e2246b0b43e9b75dcbe8fba0f1d7?pvs=4