This repository contains a template for creating a Tetris game using HTML, CSS, JavaScript, and Flask.
-
Clone this repository:
git clone https://github.com/your_username/your_repository.git
-
Navigate to the project directory:
cd your_repository
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
BACKGROUND_URL
: URL for the background image.TETRIS_THEME_MP3_URL
: URL for the Tetris theme MP3 file.
-
Run the Flask server:
python main.py
-
Open your web browser and go to
http://localhost:8080
to play the Tetris game.
- Background: Replace the background image by setting the
BACKGROUND_URL
environment variable. - Music: Change the Tetris theme music by modifying the
TETRIS_THEME_MP3_URL
environment variable. - Styling: Customize the game's appearance by editing the CSS file (
static/css/style.css
). - Functionality: Enhance or modify game mechanics by editing the JavaScript files (
static/js/tetris.js
andstatic/js/script.js
).
- Move Left: Press
A
key. - Move Right: Press
D
key. - Rotate Left: Press
Q
key. - Rotate Right: Press
E
key. - Drop Faster: Press
S
key. - Toggle Music: Click the "Toggle Music" button.