Skip to main content

Tetris with Apulian elements - a Software Engineering project.

Project description

OrecchietTetris

An exact copy of the Tetris game, with Apulian elements. Built as a Software Engineering university project.

Requirements

  • Python >= 3.11
  • Kivy >= 2.3 (installed automatically by Poetry)
  • Node >= 25 and npm >= 11.11 (for semantic-release)
  • Poetry (dependency manager)

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

  1. Clone the repository:

    git clone https://github.com/unibo-dtm-se-2425-OrecchietTetris/OrecchietTetris-artifact
    cd OrecchietTetris-artifact
    
  2. Install Poetry if you don't have it yet:

    pip install -r requirements.txt
    
  3. Install the project's dependencies (creates .venv/ inside the project):

    poetry install
    npm install
    
  4. (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
Block 1 I Mozzarella
Block 2 O Orecchietta
Block 3 T Uva (Grape)
Block 4 S Cime di rapa (Turnip Tops)
Block 5 Z Frisella
Block 6 J Cozze Tarantine (Tarantino Mussels)
Block 7 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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orecchiettetris-0.11.1.tar.gz (48.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orecchiettetris-0.11.1-py3-none-any.whl (48.4 MB view details)

Uploaded Python 3

File details

Details for the file orecchiettetris-0.11.1.tar.gz.

File metadata

  • Download URL: orecchiettetris-0.11.1.tar.gz
  • Upload date:
  • Size: 48.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for orecchiettetris-0.11.1.tar.gz
Algorithm Hash digest
SHA256 f3219c78440b8250a4d6bac23f7c3d27f384abbf7ef7868155ab8f3aa690d517
MD5 91020212fa4782821349e0c841d6dbce
BLAKE2b-256 92e78e7dc0469450b1f9cee0d1dd448c417a462b87b286a2895e491160b9f56a

See more details on using hashes here.

Provenance

The following attestation bundles were made for orecchiettetris-0.11.1.tar.gz:

Publisher: deploy.yml on unibo-dtm-se-2425-OrecchietTetris/OrecchietTetris-artifact

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orecchiettetris-0.11.1-py3-none-any.whl.

File metadata

File hashes

Hashes for orecchiettetris-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44c745c4517bf5f6503d6312c448c6f7ab8d2cfbaf1338c77174b0e7edd5039b
MD5 771315aa3dec65ed2f2bebe0857bd431
BLAKE2b-256 1c36e0764e4c6cff16f520158569366edabab32e9db6e14340df3244bc76d8c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for orecchiettetris-0.11.1-py3-none-any.whl:

Publisher: deploy.yml on unibo-dtm-se-2425-OrecchietTetris/OrecchietTetris-artifact

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page