Classic Tetris game built with vanilla JavaScript, HTML5 Canvas, and CSS. Features score tracking, level progression, piece rotation, and keyboard controls.
- Table of Contents
- Features
- Tech Stack
- Getting Started
- Project Structure
- Demo
- Authors
- Contributing
- License
- Classic Tetris gameplay mechanics
- Canvas-based rendering using HTML5 Canvas API
- Keyboard controls (arrow keys for movement and rotation)
- Score tracking system (+10 points per row cleared)
- Level progression with increasing speed
- Piece rotation with collision validation
- Row clearing when a line is completed
- Game over detection
- Start screen overlay
- Responsive controls panel
- Built with Vite for fast development and HMR
- ESLint with Standard style
- Node.js 16+
- npm, yarn, pnpm, or bun
git clone https://github.com/wrujel/tetris-javascript.git
cd tetris-javascript
npm installnpm run devOpen http://localhost:5173 with your browser to see the result.
npm run build/
├── images/
│ └── screenshot.png
├── utils/
│ ├── canvas.js
│ ├── constants.js
│ └── pieces.js
├── index.html
├── main.js
├── style.css
└── package.json
You can check out the demo:
- @wrujel — Creator & maintainer
Contributions are welcome! If you have suggestions or find bugs, please open an issue or submit a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is not currently licensed.