コード例 #1
0
        //Подключение заданий
        void TurnOnQuest()
        {
            int      r     = R.Next(0, Texts.Questions.Length);
            Question quest = new Question(Texts.Questions[r][0],
                                          Texts.Questions[r][1],
                                          Texts.Questions[r][2],
                                          Texts.Questions[r][3],
                                          Texts.Questions[r][4],
                                          Texts.Questions[r][5],
                                          Texts.Answer[r]);
            DialogResult dr = quest.ShowDialog();

            if (dr != DialogResult.OK)
            {
                HealthPoint.Value = HealthPoint.Value - Settings.Damage;
                if (HealthPoint.Value == 0)
                {
                    DialogResult result = MessageBox.Show(quest, "Health left you . Do you want Retry?", "Game Over", MessageBoxButtons.RetryCancel);
                    if (result == DialogResult.Cancel)
                    {
                        Close();
                    }
                    else
                    {
                        Close();
                        lvl lvl = new lvl();
                    }
                }
            }
            if (QuestsLeft == 0)
            {
                Close();
            }
            QuestsLeft--;
        }///////////////
コード例 #2
0
ファイル: Form1.cs プロジェクト: DKrivenko-hub/MyProjects
        private void button1_Click(object sender, EventArgs e)
        {
            lvl Lvl1 = new lvl();

            Lvl1.ShowDialog();
        }