Exemplo n.º 1
0
        }                                          //画出每个方块

        private void gameOver()
        {
            if (c.bestGrade < c.grade)                                    //判断本次成绩是否刷新纪录
            {
                c.bestGrade    = c.grade;
                bestgrade.Text = c.bestGrade.ToString();
                _2048Screen();
                _2048messageBox mes3 = new _2048messageBox();
                mes3.a = "恭喜!";
                mes3.b = "新的记录!自动为您保存截图。\r\n保存在" + bitfile;
                mes3.ShowDialog();
                c.Reset();
                drow();
                Num_pictureBox.Refresh();
            }
            else
            {
                Game_Over g = new Game_Over();
                g.bg = c.bestGrade;
                g.g  = c.grade;
                DialogResult d = g.ShowDialog();
                switch (d)
                {
                case DialogResult.Retry:
                    c.Reset();
                    drow();
                    Num_pictureBox.Refresh();
                    grade.Text     = c.grade.ToString();
                    bestgrade.Text = c.bestGrade.ToString();
                    break;

                case DialogResult.Abort:
                    _2048Screen();
                    _2048messageBox mes2 = new _2048messageBox();
                    mes2.a = "保存成功";
                    mes2.b = "保存在" + bitfile;
                    mes2.ShowDialog();
                    c.Reset();
                    classSave();
                    drow();
                    Num_pictureBox.Refresh();
                    break;

                case DialogResult.No:
                    c.Reset();
                    this.Close();
                    break;
                }
            }
        }                                                                    //游戏结束时需要的操作
Exemplo n.º 2
0
        }                                          //画出每个方块

        private void gameOver()
        {
            if (c.bestGrade < c.grade)                                    //判断本次成绩是否刷新纪录
            {
                c.bestGrade = c.grade;
                bestgrade.Text = c.bestGrade.ToString();
                _2048Screen();
                _2048messageBox mes3 = new _2048messageBox();
                mes3.a = "恭喜!";
                mes3.b = "新的记录!自动为您保存截图。\r\n保存在" + bitfile;
                mes3.ShowDialog();
                c.Reset();
                drow();
                Num_pictureBox.Refresh();

            }
            else
            {
                Game_Over g = new Game_Over();
                g.bg = c.bestGrade;
                g.g = c.grade;
                DialogResult d = g.ShowDialog();
                switch (d)
                {
                    case DialogResult.Retry:
                        c.Reset();
                        drow();
                        Num_pictureBox.Refresh();
                        grade.Text = c.grade.ToString();
                        bestgrade.Text = c.bestGrade.ToString();
                        break;
                    case DialogResult.Abort:
                        _2048Screen();
                        _2048messageBox mes2 = new _2048messageBox();
                        mes2.a = "保存成功";
                        mes2.b = "保存在" + bitfile;
                        mes2.ShowDialog();
                        c.Reset();
                        classSave();
                        drow();
                        Num_pictureBox.Refresh();
                        break;
                    case DialogResult.No:
                        c.Reset();
                        this.Close();
                        break;
                }
            }
        }                                      //游戏结束时需要的操作