Skip to content

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.

License

Notifications You must be signed in to change notification settings

BaranDev/Tetris-Game-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetris Game Template

This repository contains a template for creating a Tetris game using HTML, CSS, JavaScript, and Flask.

Usage

  1. Clone this repository:

    git clone https://github.com/your_username/your_repository.git
  2. Navigate to the project directory:

    cd your_repository
  3. Install dependencies:

    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:

    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

GitHub language count GitHub repo size License GitHub issues GitHub pull requests GitHub stars GitHub forks

Created With Lazy.AI

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published