A classic Tetris game implementation using pure JavaScript, HTML5 Canvas, and CSS without any external libraries or frameworks.
You can play the game directly here (add your deployment link once available).
- Complete Tetris gameplay mechanics
- Score tracking system
- Level progression (speed increases)
- Line clearing and scoring
- Next piece preview
- Game pause functionality
- Responsive design
- Keyboard controls
- Vanilla JavaScript (ES6+)
- HTML5 Canvas API
- CSS3
- No external libraries or frameworks
- ←/→ Arrow Keys: Move piece left/right
- ↑ Arrow Key: Rotate piece
- ↓ Arrow Key: Soft drop (faster fall)
- Space Bar: Hard drop (immediate placement)
- P: Pause/Resume game
- 1 line: 40 × level
- 2 lines: 100 × level
- 3 lines: 300 × level
- 4 lines: 1200 × level
-
Clone this repository:
git clone https://github.com/trzaskos/vanilla-js-tetris.git
-
Navigate to the project directory:
cd vanilla-js-tetris
-
Open
index.html
in your browser.
No build process or dependencies required!
- Tetromino pieces don't fully reach the right edge of the game board. This is a known limitation in the current implementation that will be addressed in future versions.
- Mobile touch controls
- Sound effects
- High score persistence using localStorage
- Animated line clears
- Hold piece functionality
- Different difficulty modes
Contributions are welcome! Feel free to open an issue or submit a pull request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- The original Tetris game created by Alexey Pajitnov
- Various Tetris guidelines that have evolved over the years
Feel free to fork this project and make your own improvements!
Maryele Trzaskos Gruber - [email protected]
Project Link: https://github.com/trzaskos/vanilla-js-tetris
If you find this project helpful, consider buying me a coffee!