Skip to content

Harshitha22594/Tetris

Repository files navigation

🎮 Tetris Game using Pygame

A classic Tetris game built using Python and Pygame, featuring sound effects, levels, scoring, animations, and a start screen. The game increases difficulty as the player progresses through levels.


📌 Features

  • Classic Tetris gameplay

  • 7 different Tetromino shapes

  • Level-based speed increase

  • Line clear animations with particle effects

  • Sound effects for:

    • Game start
    • Line clear
    • Game over
  • Start screen with background image

  • Restart and exit options after game over


🛠️ Technologies Used

  • Python 3
  • Pygame library

📂 Project Structure

Tetris/
│
├── tetris.py              # Main game file
├── background.jpg         # Start screen background
├── clear_lines.wav        # Sound for clearing lines
├── game over.wav          # Game over sound
├── Starting.wav           # Game start sound
├── README.md              # Project documentation

⚙️ Requirements

Make sure you have Python and Pygame installed.

Install Pygame

pip install pygame

▶️ How to Run the Game

  1. Clone or download the repository
  2. Make sure all sound and image files are in the same directory
  3. Run the game using:
python tetris.py

🎮 Controls

Key Action
⬅️ Left Arrow Move block left
➡️ Right Arrow Move block right
⬇️ Down Arrow Move block down faster
␣ Space Bar Rotate block
Enter Restart game (after Game Over)
Space Exit game (after Game Over)

🧮 Scoring & Levels

  • +10 points for each cleared line
  • Level increases automatically as score increases
  • Higher levels increase falling speed

🧠 Game Logic Overview

  • Grid-based board system
  • Random Tetromino generation
  • Collision detection and boundary checks
  • Line-clearing mechanism
  • Particle effects on line clear
  • Game Over detection when blocks reach the top

📸 Screens

  • Start screen with START button
  • Gameplay screen with score and level display
  • Game Over screen with final score and replay option

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors