此程序主要三个小结讲解:1、 设计方块类(block.cs)2、 设计游戏类(game.cs)3、 设计窗体类(form1.cs)通俗易懂,希望对广阔的学生们都有帮助欢迎下载技术 qq 1278263100 邮箱 1278263100@qq.com游戏所需图片:游戏运行图:话不多说:设计方块类(block.cs)程序都有注释,通俗易懂using System;using System.Collections.Generic;using System.Text;using System.Drawing;//addnamespace 俄罗斯方块{ public class Block { private short width; private short height; private short top; private short left; private int ID; //方块部件的 ID public int[,] shape; //存储方块部件的形状,0为空白,1为有砖块 public Block()//构造函数 { Random randomGenerator = new Random(); int randomBlock = randomGenerator.Next(1, 5);//产生 1—4 的数 this.ID = randomBlock; switch (this.ID) { case 1: //横条形 this.Width = 4; this.Height = 1; this.Top = 0; this.Left = 3; shape = new int[this.Width, this.Height]; shape[0, 0] = 1; shape[1, 0] = 1; shape[2, 0] = 1; shape[3, 0] = 1; break; case 2: //正方形 this.Width = 2; this.Height = 2; this.Top = 0; this.Left = 4; // Creates the new shape for this block. shape = new int[this.Width, this.Height]; shape[0, 0] = 1; shape[0, 1] = 1; shape[1, 0] = 1;shape[1, 1] = 1; break; case 3: //T形 this.Width = 3; this.Height = 3; this.Top = 0; this.Left = 4; // Creates the new shape for this block. shape = new int[this.Width, this.Height]; shape[0, 0] = 1; shape[1, 0] = 1; shape[2, 0] = 1; shape[1, 1] = 1; shape[1, 2] = 1; break; case 4: //L 形 this.Width = 2; this.Height = 3; this.Top = 0; this.Left = 4; // Creates the new shape for this block. shape = new int[this.Width, this.Height]; shape[0, 0] = 1; shape[0, 1] = 1; shape[0, 2] = 1; shape[1, 2] = 1; break; } } public short Width//Width 属性 { get { return width; } set { width = value; } ...