A complete implementation of the classic Tetris game built with vanilla HTML5, CSS3, and JavaScript. No external libraries or frameworks required. This project demonstrates game development fundamentals, object-oriented programming, and modern JavaScript concepts.
- Pure vanilla JavaScript implementation
- Classic Tetris gameplay mechanics
- Responsive controls
- Score tracking system
- Pause/Resume functionality
- No dependencies or build process required
Visit the live demo link above to play directly in your browser.
-
Clone the repository:
git clone https://github.com/hoffhannisyan/javascript-tetris.git cd javascript-tetris -
Open
index.htmlin your web browser
No installation or build process required!
| Key | Action |
|---|---|
| Enter | Start game / Restart after game over |
| Space | Pause / Resume game |
| Arrow Left (โ) | Move tetromino left |
| Arrow Right (โ) | Move tetromino right |
| Arrow Up (โ) | Rotate tetromino clockwise |
| Arrow Down (โ) | Soft drop (faster descent) |
- HTML5 Canvas
- CSS3
- Vanilla JavaScript (ES6+)
This project demonstrates:
- Game loop implementation
- Collision detection
- Object-oriented programming in JavaScript
- DOM manipulation
- Event handling
- Canvas API usage
Works on all modern browsers that support HTML5 Canvas:
- Chrome
- Firefox
- Safari
- Edge