In the previous two posts, we defined what we want our model of Tetris in Blazor to look like, and we created classes such as Grid
and CellCollection
to help model the game.
In this post, we are going to write up the C## classes that will define each tetromino, as well as enumerations for their style and orientation, their common base class, and a generator class that we will use to populate the “upcoming pieces” display in our game.
It’s a lot of work, but it’ll be super cool when we’re done. Let’s go!
Don’t forget to check out the entire BlazorGames repository over on GitHub!
A _tetromino _is a set of four (4) cells that moves as a unit on the Tetris game grid. In Tetris, tetrominos have the following properties:
#blazor #modeling practice #tutorials #sample project #games #asp.net