Exemple #1
0
        public BlockGroup()
        {
            BlockConfig config = new BlockConfig();;

            config.LoadFromXmlFile();
            info          = new InfoArr();
            info          = config.BlockInfo;
            disapperColor = config.BlockColor;
            rectPix       = config.BlockCol;
        }
Exemple #2
0
        private void FrmTetris_Load(object sender, EventArgs e)
        {
            BlockConfig config = new BlockConfig();

            config.LoadFromXmlFile();
            _upKey       = config.UpKey;
            _downKey     = config.DownKey;
            _leftKey     = config.LeftKey;
            _rightKey    = config.RightKey;
            _deasilKey   = config.DeasilKey;
            _contraKey   = config.ContraKey;
            _blockNumX   = config.BlockNumX;
            _blockNumY   = config.BlockNumY;
            _blockColnum = config.BlockCol;
            _blockColor  = config.BlockColor;

            this.Width   = _blockNumX * _blockColnum + 165;
            this.Height  = _blockNumY * _blockColnum + 55;
            pbRun.Width  = _blockNumX * _blockColnum;
            pbRun.Height = _blockNumY * _blockColnum;
        }
Exemple #3
0
        private void Config_Load(object sender, EventArgs e)
        {
            mc.LineNum_X  = 4;                                                //横线数量
            mc.Width      = lbMode.Width;                                     //宽度
            mc.LineNum_Y  = 4;                                                //竖线数量
            mc.Height     = lbMode.Height;                                    //高度
            mc.States     = new bool[(mc.LineNum_X + 1), (mc.LineNum_Y + 1)]; //每个砖块状态
            mc.BlockColor = Color.Gray;

            config.LoadFromXmlFile();   //读取
            InfoArr info = config.BlockInfo;

            ListViewItem myItem = new ListViewItem();

            for (int i = 0; i < info.Length; i++)
            {
                myItem = lsvBlockSet.Items.Add(info[i].GetIdStr());
                myItem.SubItems.Add(info[i].GetColorStr());
            }

            tbToUp.Text    = ((Keys)config.UpKey).ToString();
            tbToUp.Tag     = config.UpKey;
            tbToDown.Text  = ((Keys)config.DownKey).ToString();
            tbToDown.Tag   = config.DownKey;
            tbToleft.Text  = ((Keys)config.LeftKey).ToString();
            tbToleft.Tag   = config.LeftKey;
            tbToRight.Text = ((Keys)config.RightKey).ToString();
            tbToRight.Tag  = config.RightKey;
            tbDeasil.Text  = ((Keys)config.DeasilKey).ToString();
            tbDeasil.Tag   = config.DeasilKey;
            tbContra.Text  = ((Keys)config.ContraKey).ToString();
            tbContra.Tag   = config.ContraKey;

            tbBlockNumX.Text            = config.BlockNumX.ToString();
            tbBlockNumY.Text            = config.BlockNumY.ToString();
            tbBlockColNum.Text          = config.BlockCol.ToString();
            lbBlockBlackColor.BackColor = config.BlockColor;
        }