A classic Tetris game implementation built with Blazor Server and C#.
- Classic Tetris gameplay with all standard tetrominoes (I, O, T, S, Z, J, L)
- Real-time game mechanics including piece rotation, line clearing, and gravity
- Score tracking and level progression
- Local storage for high scores persistence
- Responsive web interface
- Keyboard controls for seamless gameplay
- Blazor Server - Interactive web UI framework
- C# - Game logic and server-side processing
- JavaScript - Client-side interactions and animations
- CSS - Styling and visual effects
- HTML5 - Modern web standards
- Arrow Left/Right - Move piece horizontally
- Arrow Down - Soft drop (faster piece descent)
- Arrow Up, A, D, or R - Rotate piece
- Space - Hard drop (instant piece placement)
- P - Pause/Resume game
Models/- Game entities (Tetromino, GameBoard, GameState, etc.)Services/- Business logic (GameService, LocalStorageService)Pages/- Blazor pages and componentswwwroot/- Static assets (CSS, JavaScript)
- .NET 9.0 or later
- Any modern web browser
- Clone the repository
- Navigate to the project directory
- Run the following commands:
dotnet restore
dotnet run- Open your browser and navigate to the displayed URL (typically
https://localhost:5001)
- Line Clearing: Complete horizontal lines are automatically cleared
- Scoring: Points awarded for line clears, with bonuses for multiple lines
- Level Progression: Game speed increases as you clear more lines
- Game Over: Occurs when pieces reach the top of the playing field
Feel free to submit issues and pull requests to improve the game!
This project is open source and available under the MIT License.