https://github.com/barandev/tetris-game-template
This app combines Flask backend with JavaScript frontend to create Tetris. Flask serves HTML template with game canvas and music URLs. JavaScript handles game logic, including movement and scoring.
https://github.com/barandev/tetris-game-template
Last synced: over 1 year ago
JSON representation
This app combines Flask backend with JavaScript frontend to create Tetris. Flask serves HTML template with game canvas and music URLs. JavaScript handles game logic, including movement and scoring.
- Host: GitHub
- URL: https://github.com/barandev/tetris-game-template
- Owner: BaranDev
- License: mit
- Created: 2024-02-29T00:02:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-04T09:16:03.000Z (over 2 years ago)
- Last Synced: 2024-04-04T10:30:51.580Z (over 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tetris Game Template
This repository contains a template for creating a Tetris game using HTML, CSS, JavaScript, and Flask.
## Usage
1. Clone this repository:
```bash
git clone https://github.com/your_username/your_repository.git
```
2. Navigate to the project directory:
```bash
cd your_repository
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Set up environment variables:
- `BACKGROUND_URL`: URL for the background image.
- `TETRIS_THEME_MP3_URL`: URL for the Tetris theme MP3 file.
5. Run the Flask server:
```bash
python main.py
```
6. Open your web browser and go to `http://localhost:8080` to play the Tetris game.
## Customization
- **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` and `static/js/script.js`).
## Tetris Controls
- **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.
## Screenshots
###
###


[](https://github.com/barandev/Tetris-Game-Template/blob/main/LICENSE)
[](https://github.com/barandev/Tetris-Game-Template/issues)
[](https://github.com/barandev/Tetris-Game-Template/pulls)
[](https://github.com/barandev/Tetris-Game-Template/stargazers)
[](https://github.com/barandev/Tetris-Game-Template/network)
### Created With [Lazy.AI](https://www.getlazy.ai)