예제 #1
0
 private void addNextBrick()
 {
     this.Now_Brick_X     = 4;
     this.Now_Brick_Y     = -1;
     this.Now_Brick_Num   = this.Next_Brick_Num;
     this.NowBrick        = (SuperBrick)this.BrickArray[this.Now_Brick_Num];
     this.Now_Brick_Color = this.Next_Brick_Color;
     this.createNextBrick();
 }
예제 #2
0
        public void start()        //开始
        {
            try
            {
                this.Now_Brick_Num    = 0;
                this.Now_Brick_Direct = 0;
                this.Now_Brick_X      = 0;
                this.Now_Brick_Y      = 0;
                this.NowBrick         = new Brick_BB();
                for (int i = 0; i < this.Gridx; i++)
                {
                    for (int j = 0; j < this.Gridy; j++)
                    {
                        this.Map_Array[i, j]       = 0;
                        this.Map_Color_Array[i, j] = 0;
                    }
                }

                this.Next_Brick_Num2   = 0;
                this.Next_Brick_Color2 = 1;      //this.con.BackColor;
                this.createNextBrick();          //两次创建下一个方块
                this.createNextBrick();          //创建下一 个防块
                this.addNextBrick();             //加入方块

                this.Game_Line = 0;              //
                //消行所用!
                if (this.Bo_Image != null)
                {
                    this.Bo_Image.Dispose();
                }

                this.Bo_Image = new Bitmap(this.formControl.Root_Module, this.con.Width, this.con.Height);
                //背景模板
                if (this.module != null)
                {
                    this.module.Dispose();
                }

                this.module = new Bitmap(this.formControl.Root_Module, this.con.Width, this.con.Height);
                //开始
                this.single_start = true;

                //道具数量=0
                this.toolSum = 0;
            }
            catch {}
//
        }
예제 #3
0
        //画出type对应的方块
        public void DrawBrickGroup(int x, int y, int type, int direct, int c, Graphics g3)    //画出type对应的方块
        {
            try
            {
                SuperBrick sb = (SuperBrick)st.BrickArray[type];

                for (int i = 0; i < 5; i++)         //绘出现在的方块
                {
                    for (int j = 0; j < 5; j++)
                    {
                        if (sb.Brick_Array[direct, i, j] == 1)
                        {
                            this.DrawBrick(i + x, j + y, c, g3);
                        }
                    }
                }
            }
            catch {}
        }
예제 #4
0
        public bool isPut(int x, int y, int type, int mode)     //mode=direct 方块是否可
        {
            SuperBrick sb = (SuperBrick)this.BrickArray[type];

            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    if (sb.Brick_Array[mode, i, j] == 1)
                    {
                        if ((i + x) < 0 || (i + x) > (this.Gridx - 1) || (j + y) < 0 || (j + y) > (this.Gridy - 1) || (this.Map_Array[i + x, j + y] == 1))//有问题?????
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }