A classic Tetris game built using HTML, CSS, and JavaScript, featuring smooth gameplay, piece rotation, collision detection, scoring, and responsive controls.
👉 https://tetris-sage-iota.vercel.app/
- 🧩 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
| Key | Action |
|---|---|
| ⬅️ Arrow Left | Move Left |
| ➡️ Arrow Right | Move Right |
| ⬇️ Arrow Down | Soft Drop |
| ⬆️ Arrow Up | Rotate |
| Space | Hard Drop |
| R | Restart Game |
- HTML5 – Structure
- CSS3 – Styling
- JavaScript (ES6) – Game logic
- Canvas API – Rendering the game
- Game loop using
requestAnimationFrame - State management
- Matrix rotation (for piece rotation)
- Collision detection
- Grid-based rendering
- Event handling (keyboard input)
Tetris-Game/
│── index.html
│── tetris.css
│── tetris.js
- 🎵 Sound effects
- 👻 Ghost piece preview
- 🏆 High score (localStorage)
- 🎚️ Levels with increasing speed
- 📱 Mobile controls
- 🎬 Line clear animations
Inspired by the classic Tetris game.
Feel free to connect with me for feedback or collaboration!
⭐ If you like this project, give it a star!