Exemplo n.º 1
0
        public void GameProcesstime()
        {
            ResultForm resultFormOnGameForm = new ResultForm();

            ScoreCountLabelOnGameForm.Text = Convert.ToString(score);


            do
            {
                if (operation == 1)
                {
                    Plus();
                    conditionwritetimemode();
                }
                else if (operation == 0)
                {
                    Minus();
                    conditionwritetimemode();
                }
                else if (operation == 2)
                {
                    Power();
                    conditionwritetimemode();
                }
                else if (operation == 3)
                {
                    Divide();
                    conditionwritetimemode();
                }
                if (timelimiter == false)
                {
                    break;
                }
            }while (timelimiter == false);

            if (timelimiter == false)
            {
                timer1.Enabled = false;
                MessageBox.Show("Время вышло!");
                resultFormOnGameForm.elapsedTimeSeconds  = s;
                resultFormOnGameForm.elspasedTimeMinutes = m;
                resultFormOnGameForm.scoreoonResultForm  = score;
                resultFormOnGameForm.numerOnResultForm   = numer;
                resultFormOnGameForm.gamemodenumber      = gamemode;
                resultFormOnGameForm.iongame             = i;

                resultFormOnGameForm.Show();
                this.Close();
            }
        }
Exemplo n.º 2
0
        public void GameProcesstraining()
        {
            ResultForm resultFormOnGameForm = new ResultForm();

            ScoreCountLabelOnGameForm.Text = Convert.ToString(score);

            do
            {
                {
                    if (operation == 1)
                    {
                        Plus();
                        conditionwritetrainingmode();
                    }
                    else if (operation == 0)
                    {
                        Minus();
                        conditionwritetrainingmode();
                    }
                    else if (operation == 2)
                    {
                        Power();
                        conditionwritetrainingmode();
                    }
                    else if (operation == 3)
                    {
                        Divide();
                        conditionwritetrainingmode();
                    }
                }
            } while (i > numer);
            if (i == numer)
            {
                timer1.Enabled = false;
                MessageBox.Show("Игра окончена!");
                resultFormOnGameForm.elapsedTimeSeconds  = s;
                resultFormOnGameForm.elspasedTimeMinutes = m;
                resultFormOnGameForm.scoreoonResultForm  = score;
                resultFormOnGameForm.numerOnResultForm   = numer;
                resultFormOnGameForm.gamemodenumber      = gamemode;
                resultFormOnGameForm.Show();
                this.Close();
            }
        }
Exemplo n.º 3
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            ResultForm resultFormOnGameForm = new ResultForm();

            if (s < 59)
            {
                s++;
                if (s < 10)
                {
                    TimeCountSecondsLabelOnGameForm.Text = "0" + s.ToString();
                }
                else
                {
                    TimeCountSecondsLabelOnGameForm.Text = s.ToString();
                }
            }
            else
            {
                if (m < 59)
                {
                    m++;
                    if (m < 10)
                    {
                        TimeCountMinutesLabelOnGameForm.Text = "0" + m.ToString();
                    }
                    else
                    {
                        TimeCountMinutesLabelOnGameForm.Text = m.ToString();
                    }
                    s = 0;
                    TimeCountSecondsLabelOnGameForm.Text = "00";
                }
                else
                {
                    m = 0;
                    TimeCountMinutesLabelOnGameForm.Text = "00";
                }
            }
        }
Exemplo n.º 4
0
        private void StartButtonOnMainForm_Click(object sender, EventArgs e)
        {
            ResultForm resultForm = new ResultForm();

            if ((lvl1.Checked || lvl2.Checked || lvl3.Checked) && training_mode.Checked && (num10.Checked || num20.Checked || num30.Checked) || (lvl1.Checked || lvl2.Checked || lvl3.Checked) && time_mode.Checked && (sec30button.Checked || minute1button.Checked || minute2button.Checked || minute5button.Checked))
            {
                if (lvl1.Checked)
                {
                    gameFormonmain.lvl = 1;
                }
                else if (lvl2.Checked)
                {
                    gameFormonmain.lvl = 2;
                }
                else if (lvl3.Checked)
                {
                    gameFormonmain.lvl = 3;
                }

                if (time_mode.Checked)
                {
                    gameFormonmain.gamemode = 1;
                }
                else if (training_mode.Checked)
                {
                    gameFormonmain.gamemode = 2;
                }

                if (num10.Checked)
                {
                    gameFormonmain.numer = 10; resultForm.numerOnResultForm = 10;
                }
                else if (num20.Checked)
                {
                    gameFormonmain.numer = 20; resultForm.numerOnResultForm = 20;
                }
                else if (num30.Checked)
                {
                    gameFormonmain.numer = 30; resultForm.numerOnResultForm = 30;
                }

                if (sec30button.Checked)
                {
                    gameFormonmain.timevalue = 1;
                }
                else if (minute1button.Checked)
                {
                    gameFormonmain.timevalue = 2;
                }
                else if (minute2button.Checked)
                {
                    gameFormonmain.timevalue = 3;
                }
                else if (minute5button.Checked)
                {
                    gameFormonmain.timevalue = 4;
                }
                this.Hide();
                gameFormonmain.Show();
            }
            else
            {
                MessageBox.Show("Не выбрана сложность или режим игры или количество вопросов", "Ошибка!");
            }
        }