introduce
Use Silverlight 2.0 (c#) to develop a colorful Tetris
How to play
↑ - transform; ← - move to the left; → - move to the right; ↓ - move down
1. Each shape is composed of 4 "blocks", that is, "block" is the smallest unit of Tetris. First, there must be a "block" user control. It is required that the position and color of the "block" can be set
2. Classic Tetris has a total of 7 shapes. Abstract the functions required by each shape and write an abstract class. The 7 specific shapes inherit this abstract class and rewrite its abstract attributes and abstract methods.
3. Core control part: fill the container with hidden "blocks", control the deformation and movement of the shape up/down/left/right/, and respond to changes by controlling the color of the "blocks" in the container. When the shape moves next Or when the deformed position already has color, the movement or deformation is prohibited. When the next move or deformed position of the shape has color at the bottom or is at the bottom of the container, it is judged to be canceled and a new shape is generated.
YYTetris.Web/YYTetrisTestPage.aspx is the game running page
Ideas
1. Each shape is composed of 4 "blocks", that is, "block" is the smallest unit of Tetris. First, there must be a "block" user control. It is required that the position and color of the "block" can be set
2. Classic Tetris has a total of 7 shapes. Abstract the functions required by each shape and write an abstract class. The 7 specific shapes inherit this abstract class and rewrite its abstract attributes and abstract methods.
3. Core control part: fill the container with hidden "blocks", control the deformation and movement of the shape up/down/left/right/, and respond to changes by controlling the color of the "blocks" in the container. When the shape moves next Or when the deformed position already has color, the movement or deformation is prohibited. When the next move or deformed position of the shape has color at the bottom or is at the bottom of the container, it is judged to be canceled and a new shape is generated.
Expand