Skip to content

Latest commit

 

History

History
72 lines (63 loc) · 2.77 KB

File metadata and controls

72 lines (63 loc) · 2.77 KB

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