An exact copy of the Tetris game, with Apulian elements. Built as a Software Engineering university project.
Requirements
- Python >= 3.11
- Poetry (dependency manager)
- Kivy >= 2.3 (installed automatically by Poetry)
- Node >= 25 and npm >= 11.11 (for semantic-release)
In-Game keyboard controls
| Key | Action |
|---|---|
| ← / → | Move left / right |
| ↓ | Soft drop |
| ↑ or X | Rotate clockwise |
| Space | Hard drop |
| C | Hold |
| P or Escape | Pause / Resume |
| Q | Quit |
| M | Toggle music |
| N | Next track |
| B | Previous track |
Installation
From PyPI
pip install OrecchietTetris
OrecchietTetris
From source
-
Clone the repository:
git clone https://github.com/unibo-dtm-se-2425-OrecchietTetris/OrecchietTetris-artifact cd OrecchietTetris-artifact
-
Install Poetry if you don't have it yet:
pip install -r requirements.txt
-
Install the project's dependencies (creates
.venv/inside the project):poetry install npm install
-
(Optional) Install pre-commit hooks for commit-message linting:
.venv/bin/poe hooks # macOS / Linux .venv\Scripts\poe hooks # Windows
Virtual environment
All project commands run inside the .venv/ virtual environment created by Poetry.
Activate it once per terminal session, then use tools directly without any prefix:
python3 -m venv .venv
# macOS / Linux
source .venv/bin/activate
# Windows (PowerShell)
.venv\Scripts\Activate.ps1
# Windows (cmd)
.venv\Scripts\activate.bat
To deactivate:
deactivate
Usage
Activate the virtual environment (see above), then run the game:
OrecchietTetris
or:
python -m OrecchietTetris
Development
Activate the virtual environment first, then use the following commands directly.
Run tests
poe test
Run a single test file or test case:
pytest -v tests/model/test_tetromino.py
pytest -v tests/model/test_tetromino.py::test_rotations
Coverage
poe coverage
Lint & type check
poe flake8
poe mypy
Architecture
The project uses the Observer pattern to decouple game logic from the view, with abstract interfaces for dependency inversion.
Components
| Component | Role |
|---|---|
Tetromino(ITetromino) |
Falling piece with clockwise rotation |
Board(IBoard) |
Pure grid engine — collision, locking, line clearing |
Tetris(ITetris) |
Game orchestrator; fires EventType events on every state change |
MenuScreen(IView) |
Kivy main menu with language selector |
GameScreen(IView) |
Kivy 10×20 board, previews, score, keyboard input |
TetrisApp(App) |
Kivy application; manages screen transitions |
I18n |
Runtime EN/IT string lookup |
BlockRenderer |
Maps piece integers to RGBA colours and image paths |
Observer events (EventType enum)
| Event | When | Data |
|---|---|---|
BOARD_UPDATED |
piece moved, rotated, or locked | None |
NEW_PIECE |
new piece spawned | ITetromino |
HOLD_UPDATED |
hold slot changed | ITetromino | None |
LINES_CLEARED |
lines removed | int |
SCORE_UPDATED |
score changed | int |
GAME_OVER |
spawn blocked | None |
PAUSED / RESUMED |
pause toggled | None |
Tetromino Blocks
Each tetromino uses a unique block icon drawn from Apulian food imagery.
| Block | Shape | Apulian Food |
|---|---|---|
| I | Mozzarella | |
| O | Orecchietta | |
| T | Uva (Grape) | |
| S | Cime di rapa (Turnip Tops) | |
| Z | Frisella | |
| J | Cozze Tarantine (Tarantino Mussels) | |
| L | Focaccia |
Soundtrack
You are not ready for this. A list of the best Apulian - and not only - artists!
| Track | Artist | Song |
|---|---|---|
| 01 | Caparezza | Abiura di Me |
| 02 | Serena Brancale | Baccalà |
| 03 | Kid Yugi | Massafghanistan |
| 04 | Sud Sound System | Le Radici Ca Tieni |
| 05 | Boombadash ft. Alessandra Amoroso | Mambo Salentino |
| 06 | Sal Da Vinci | Rossetto e Caffè |
| 07 | Al Bano ft. Romina Power | Felicità |
| 08 | Caparezza | Jodellavitanonhocapitouncazzo |
| 09 | Checco Zalone | Angela |
| 10 | Elvira Visone ft. Luca Sarracino | Mi Hai Rotto il Cuore |
| 11 | Domenico Bini | Sta Andando Tutto Male |
| 12 | Leone Di Lernia | La festa d' patron |
| 13 | GemBoy | La Guerra Di Piero |
You can find the .mp3 files of the soundtrack in assets/music/mp3. Enjoy!
Metadata
Release files for OrecchietTetris 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| orecchiettetris-1.1.1.tar.gz | 48.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| orecchiettetris-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 96.8 MB
Release files / orecchiettetris-1.1.1.tar.gz
| Download URL | orecchiettetris-1.1.1.tar.gz |
|---|---|
| Size | 48.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01e4075c73be078b1ce84127ce1607746bafe1de082c05c06a8ec8c798627647
|
|
BLAKE2b-256 checksum How to use checksums |
a2ba15ed9271231d843ee37f676b9305dc4c072b4f3a2111f453b2148cf007f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.
Transparency logRelease files / orecchiettetris-1.1.1-py3-none-any.whl
| Download URL | orecchiettetris-1.1.1-py3-none-any.whl |
|---|---|
| Size | 48.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34d4f4e55783722d95aa2c300221ba633875612431ef343c09e3ab48c8e356b6
|
|
BLAKE2b-256 checksum How to use checksums |
68614d72a31b065c6b20c54921c8b842baa9ee4569a8eafbc2f246756d934d89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.
Transparency log