Skip to content

Implementation of the classic Tetris game using JavaFX. The project is built on the MVC architecture and includes features such as keyboard controls, score tracking, level progression, dynamic piece generation, and line clearing. The game supports a graphical interface and animation, ensuring a smooth gameplay experience.

License

Notifications You must be signed in to change notification settings

Akineyshen/TetrisJavaFX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetris JavaFX

Language Library Size Last Commit

Features

  • 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.
  • Dynamic Piece Generation: Randomly generates Tetris pieces for gameplay.
  • Line Clearing: Automatically removes full lines and updates the score.
  • Timer: Tracks the elapsed time during gameplay.
  • MVC Architecture: Clean separation of concerns with Model-View-Controller design.
  • JavaFX Rendering: Uses JavaFX for graphical rendering of the game.

Unit Testing

  • ModelTest: Tests for game logic, including piece movement, line clearing, scoring, and game state.

Tests

Requirements

  • Java: JDK 21 or newer.
  • Maven: For dependency management and building the project.
  • JavaFX: For graphical rendering.

Installation

  1. Clone the repositury:
    git clone https://github.com/Akineyshen/TetrisJavaFX.git
  2. Navigate to the project directory:
    cd TetrisJavaFX
  3. Build the project using Maven:
    mvn clean install
  4. Navigate to the java folder:
    Open the java folder.
  5. Run the application:
    Right-click on the file Tetris.
    Select "Run Tetris.main()".

Project Structure

    TetrisJavaFX/
    ├── src/ # Source code
    │   ├── main/
    │   │   ├── java/
    │   │   │   ├── Controller/ # Controller logic
    │   │   │   ├── Model/ # Game logic and data
    │   │   │   ├── View/ # Rendering logic
    │   │   │   └── Tetris # Main entry point
    │   │   └── resources/ # Game resources
    │   └── test/ # Unit tests
    ├── .gitignore # Ignored files
    ├── pom.xml # Maven configuration
    └── README.md # Project description

Screenshots

TetrisGame

GameOver

About

Implementation of the classic Tetris game using JavaFX. The project is built on the MVC architecture and includes features such as keyboard controls, score tracking, level progression, dynamic piece generation, and line clearing. The game supports a graphical interface and animation, ensuring a smooth gameplay experience.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages