A small Tetris clone written in Python using pygame.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -r requirements.txtFrom the project root (where main.py lives), with your virtual environment activated:
python3 main.pyIf python3 is not available on your system, replace it with python.
- Left/Right: move
- Down: soft drop
- Up / X: rotate clockwise
- Z: rotate counterclockwise
- Space: hard drop
- C / Shift: hold
- P / Esc: pause
- R: restart
- Q: quit
This is an “engine-first” implementation: board/piece logic is separated from rendering, so you can tweak rules (scoring, speed curve, rotation system) without touching drawing code.