private SingleTetirs st = null; //方块后台类 public MoveNext_Brick(Panel p, SingleTetirs sTetirs) { this.Next_panel = p; this.st = sTetirs; this.Next_draw = new Draw(this.st); Thread t = new Thread(new ThreadStart(this.drawNext_Brick)); t.IsBackground = true; t.Start(); }
//初始 各变量 和 所需 类 #region 初始 void init() { try { this.Opacity = 0.0; Color c = Color.FromArgb(45, 45, 45); //设置游戏容器背景 Image_Procces.ImageForBackImage(this.panel1); //设置游戏下个方块背景 this.panel2.BackColor = c; Image_Procces.ImageForBackImage(this.panel2); //对方浏览窗体的背景1 //键盘设置 key[0] = Keys.Up; // 旋转 key[1] = Keys.Down; //加速 key[2] = Keys.Left; //向左 key[3] = Keys.Right; //向右 key[4] = Keys.Space; key[5] = Keys.S; //切换道具 key[6] = Keys.D1; //对1号使用道具 key[7] = Keys.D2; key[8] = Keys.D3; key[9] = Keys.D4; key[10] = Keys.D5; key[11] = Keys.D6; //对6号使用道具 keysSet.getForm(this); //参数设置获得主界面 // 彩色背景图片(如 人物形象) ColorImage[0] = new Bitmap(@"图片\man1.gif"); ColorImage[1] = new Bitmap(@"图片\man2.gif"); ColorImage[2] = new Bitmap(@"图片\man3.gif"); ColorImage[3] = new Bitmap(@"图片\man4.gif"); ColorImage[4] = new Bitmap(@"图片\man5.gif"); ColorImage[5] = new Bitmap(@"图片\man6.gif"); //主游戏区 背景灰化 Image_Procces.Image_Hui(ColorImage[0], this.panel1); Root_Module = new Bitmap(this.panel1.BackgroundImage, this.panel1.Width, this.panel1.Height); Image_Procces.Image_AddPicture(ColorImage[0], this.panel1); this.block = new SingleTetirs(this.panel1, 12, 21, 16, this); //(Control con1,int gridx,int gridy,int side,Form formControl) //背景音乐 this.soundBack = new SoundBack(); } catch {} }
public Draw(SingleTetirs s) { this.st = s; }