A web-based Tetris game built with Python (Flask) and JavaScript.
- Classic Tetris gameplay
- Score tracking
- Level progression
- Next piece preview
- Responsive design
- Python 3.7+
- Flask
- Clone this repository
- Install dependencies:
pip install -r requirements.txt
- Start the Flask server:
python app.py
- Open your web browser and navigate to:
http://127.0.0.1:5000/
- Arrow Left/Right: Move piece horizontally
- Arrow Up: Rotate piece
- Arrow Down: Soft drop (accelerate downward movement)
- Spacebar: Hard drop (instant placement)
- P: Pause/Resume game
- The game starts with an empty board and randomly generates Tetris pieces (tetrominoes).
- Guide the falling pieces and create complete horizontal lines to clear them.
- The game ends when pieces stack to the top of the board.
- Clearing multiple lines at once awards more points.
- As you clear lines, the level increases, making pieces fall faster.
- Backend: Python with Flask
- Frontend: HTML, CSS, and vanilla JavaScript
- Game rendering: HTML5 Canvas API