Skip to content
Suraj-12343423Public

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Tetris Game (JavaScript)

A classic Tetris game built using HTML, CSS, and JavaScript, featuring smooth gameplay, piece rotation, collision detection, scoring, and responsive controls.


🚀 Live Demo

👉 https://tetris-sage-iota.vercel.app/


📌 Features

  • 🧩 Classic Tetris gameplay
  • ⬅️➡️ Move pieces left/right
  • 🔄 Rotate pieces
  • ⬇️ Soft drop
  • ⚡ Hard drop (instant fall)
  • 🧠 Collision detection system
  • 🧱 Line clearing logic
  • 🎯 Score tracking
  • 🎮 Game Over screen
  • 🔁 Restart functionality

🎮 Controls

Key Action
⬅️ Arrow Left Move Left
➡️ Arrow Right Move Right
⬇️ Arrow Down Soft Drop
⬆️ Arrow Up Rotate
Space Hard Drop
R Restart Game

🛠️ Tech Stack

  • HTML5 – Structure
  • CSS3 – Styling
  • JavaScript (ES6) – Game logic
  • Canvas API – Rendering the game

🧠 Concepts Used

  • Game loop using requestAnimationFrame
  • State management
  • Matrix rotation (for piece rotation)
  • Collision detection
  • Grid-based rendering
  • Event handling (keyboard input)

📂 Project Structure

Tetris-Game/
│── index.html
│── tetris.css
│── tetris.js


🔥 Future Improvements

  • 🎵 Sound effects
  • 👻 Ghost piece preview
  • 🏆 High score (localStorage)
  • 🎚️ Levels with increasing speed
  • 📱 Mobile controls
  • 🎬 Line clear animations

📸 Screenshot

image

🙌 Acknowledgements

Inspired by the classic Tetris game.


📬 Contact

Feel free to connect with me for feedback or collaboration!


⭐ If you like this project, give it a star!

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages