Skip to content
Team14-SE-TetrisPublic

About

SE Lec TeamProject

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

129 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text-based Tetris with Java, JavaFX, JUnit5, and TestFX

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.

Table of Contents

Introduction

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.

Features

  • 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

Requirements

  • Java Development Kit (JDK) 11 or higher
  • Eclipse IDE
  • JavaFX SDK
  • JUnit5
  • TestFX

Setup

Follow these steps to set up the project in Eclipse:

  1. Clone the Repository:

    git clone https://github.com/Team14-SE-Tetris/Tetris.git
  2. Import the Project into Eclipse:

    • Open Eclipse IDE.
    • Go to File > Import > Existing Projects into Workspace.
    • Select the cloned repository folder and click Finish.
  3. Add JavaFX to Your Project:

    • Download JavaFX SDK from here.
    • Follow the instructions to set up JavaFX in Eclipse as described here.

Usage

  • Run the Game:

    • In Eclipse, locate the StartMenu class in the src directory.
    • Right-click on the StartMenu class and select Run As > Java Application.
  • 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.

Testing

  • Run Unit Tests:

    • In Eclipse, right-click on the test directory and select Run As > JUnit Test.
  • Run UI Tests:

    • Ensure your tests are located in the test directory and follow the TestFX framework.
    • Right-click on the test class and select Run As > JUnit Test.

Contributing

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.

License

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

About

SE Lec TeamProject

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages