Blaztris
Sharp as a knife!
Introduction
Tetris writting using Blazor/WASM/C#.
Gigabytes of fun in only 22 megabytes!
(poetic freedom for my friend Gn0ek)
Controls
Use cursor keys ▲ ▶ ▼ ◀ SPACE or I J K L M SPACE to control the game.
Minimal template
dotnet new blazorwasm
Stripped out bootstrap, WeatherController, Layouts, Pages, Routing etc. You can use this
as a minimal template which custom components with code-behind
(original template does uses @code blocks inline). However if you need more than this really Single Page App,
do not look further than dotnet new blazorwasm.
Architecture
- demonstrates the use of components (partial classes, implicitly inherited from
ComponentBase)- many small and lean components (only presentation logic)
- code behind, scoped css per component
- the concept of services for logic (block, bucket, draw, keyboard) to prevent components clobbering up with logic)
- dependency injection for services (cannot use constructor injection because of needed implicit parameterless constructor for Blazor components)
Opinion
Depending on your use case, ~22 MB over the line might be a lots of bytes. (the optimized wasm-tools build is smaller)
Version history
| Date | What |
|---|---|
| Apr 5 2024 08:57:41 | Upgraded .NET 7 → .NET 8, refactor to use .NET 8 features |
| Aug 28 2023 15:19:10 | Initial release |
| Feb 6 2022 14:56:28 | Initial version |