Go to file
2024-01-17 12:32:24 +00:00
.github/workflows Delete .github/workflows/release.yml 2024-01-09 19:40:20 +02:00
assets feat(game): update preview tetromino color 2024-01-15 06:52:57 +02:00
src feat(game): add pause screen 2024-01-16 19:55:22 +02:00
tests chore(gh-actions): add tests 2024-01-09 18:07:00 +02:00
tetris chore(gh-actions): add linting 2024-01-09 17:55:02 +02:00
typst chore(build): auto-build pdf 2024-01-17 12:32:24 +00:00
.gitignore docs: update install instructions 2024-01-17 14:26:05 +02:00
LICENSE Initial commit 2024-01-03 22:35:26 +02:00
main.py refactor(game): remove main.py 2024-01-07 20:19:17 +02:00
pyproject.toml chore: bump up the version 2024-01-16 23:46:59 +02:00
README.md fix: typo 2024-01-17 14:31:57 +02:00
requirements_dev.txt chore(gh-actions): add linting 2024-01-09 17:55:02 +02:00
requirements.txt feat: make installable 2024-01-07 19:46:06 +02:00
settings.toml docs: remove WIP 2024-01-16 20:55:29 +02:00

Tetris

Tests Lint

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 -e .
  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.
  • 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

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

Action Settings

  • hold: Defines the keys to hold the tetromino (WIP2).
  • 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). ↩︎

  2. Work In Progress. ↩︎