Tetris/README.md
2024-01-07 20:43:37 +02:00

2.6 KiB

Tetris

Overview

Welcome to Tetris, a classic and timeless game implemented in Python using the Pygame library.

Prerequisites

Before running the Tetris game, make sure you have the following installed on your system:

  • Python (version 3.11 recommended)

Running the game

  1. Clone the repository:
git clone https://github.com/kristoferssolo/Tetris
  1. Navigate to the project directory:
cd Tetris
  1. Install the required dependencies:
pip install .
  1. Run the game:
python main.py
# or
python -m tetris

Settings

The settings.toml file is a configuration file for customizing various aspects of the game.

General Settings

  • Pause: Defines the keys to pause the game. Currently a work in progress (WIP).
  • Quit: Defines the key(s) to quit the game.
  • Colorscheme: Specifies the color scheme for the game interface. Options include:
    • tokyonight-night
    • tokyonight-storm
    • tokyonight-day
    • tokyonight-moon

Movement Settings

  • Left: Defines the keys to move the tetromino1 left.
  • Right: Defines the keys to move the tetromino right.
  • Down: Defines the keys to accelerate the tetromino's fall.

Rotation Settings

  • Clockwise (cw): Defines the keys to rotate the tetromino in a clockwise direction.
  • Counter-Clockwise (ccw): Defines the keys to rotate the tetromino in a counter-clockwise direction.

Action Settings

  • Hold: Defines the keys to hold the tetromino (WIP).
  • Drop: Defines the keys to instantly drop the tetromino.

Volume Settings

Music

  • Enabled: Indicates whether music is enabled.
  • Level: Specifies the volume level for the music.

Sound Effects (SFX)

  • Enabled: Indicates whether sound effects are enabled.
  • Level: Specifies the volume level for the sound effects.

Acknowledgments

Thanks to Folke, the creator of TokyoNight color theme.


  1. A tetromino is a geometric shape composed of four squares, connected orthogonally (i.e. at the edges and not the corners). ↩︎