A modern, responsive Tetris game built with HTML5 Canvas, CSS3, and JavaScript.
ex2uply
- Classic Tetris gameplay with all 7 standard tetromino pieces
- Next piece preview - See what's coming next
- Level progression - Speed increases as you level up
- Score tracking - Points based on lines cleared and level
- Line counting - Track total lines cleared
- Game controls - Start, pause, and reset functionality
- ← → - Move piece left/right
- ↑ - Rotate piece clockwise
- ↓ - Soft drop (move down faster)
- Space - Hard drop (instant drop)
- Q/E - Alternative rotate controls
- Clone or download the project files
- Open
index.htmlin your web browser - Start playing immediately - no additional setup required!
tetris_game/
├── index.html # Main HTML file
├── style.css # CSS styles and responsive design
├── main.js # Game logic and functionality
└── README.md # This file
- Start the game by clicking the "Start Game" button
- Control the falling pieces using arrow keys
- Complete horizontal lines to clear them and score points
- Level up by clearing more lines - speed increases with each level
- Avoid filling the board - game ends when pieces reach the top
- Line clear: 100 points × current level
- Soft drop: 1 point per cell moved down
- Hard drop: 2 points per cell moved down
- Level progression: Every 10 lines cleared = new level
- HTML5 - Semantic markup and structure
- CSS3 - Modern styling with CSS Grid, Flexbox, and custom properties
- JavaScript (ES6+) - Game logic and canvas rendering
- Canvas API - 2D graphics rendering
- Font Awesome - Icons and visual elements
- Google Fonts - Segoe UI typography
- Object-oriented design - Clean, maintainable code structure
- Responsive canvas - Adapts to different screen sizes
- Smooth animations - 60fps rendering with requestAnimationFrame
- Memory efficient - Optimized rendering and state management
- Cross-browser compatible - Works on all modern browsers
- ✅ Chrome 60+
- ✅ Firefox 55+
- ✅ Safari 12+
- ✅ Edge 79+
- Colors: Update CSS custom properties in
:root - Speed: Modify timing in
main.jsupdate function - Scoring: Adjust point values in scoring functions
- Layout: Modify CSS Grid and Flexbox properties
Working on adding the following:
- Sound effects - Audio API integration
- High scores - LocalStorage implementation
- Multiplayer - WebSocket integration
- Touch controls - Touch event handlers
- None currently reported
Feel free to contribute to this project by:
- Forking the repository
- Creating a feature branch
- Making your changes
- Submitting a pull request
This project is open source and available under the MIT License.
Enjoy playing Tetris! 🎮
Built with ❤️ by ex2uply