コード例 #1
0
        private void GameplayForm_Load(object sender, EventArgs e)
        {
            PlayerOneGroupbox.Text = Player1.Name;
            PlayerTwoGroupbox.Text = Player2.Name;

            RoundTimer.Start();
        }
コード例 #2
0
ファイル: PexesoService.cs プロジェクト: jurcik46/Pexeso
        public void StartPexeso(int row, int columns)
        {
            CreateCardsForGame(row, columns);
            Score = 0;

            RoundTimer.Start();
            ChoseSecondCardTimer.Start();
            TurnTimer.Start();

            RoundStopWatch.Start();
            TurnStopWatch.Start();
            //ChoseSecondCardStopwatch.Start();
        }
コード例 #3
0
        private void RoundTimer_Tick(object sender, EventArgs e)
        {
            _ticks++;
            int myCountdown = roundLimit - _ticks;

            TimeCountLabel.Text = myCountdown.ToString();
            if (_ticks == roundLimit)
            {
                RoundTimer.Stop();

                if (PlayerOneGroupbox.Enabled == true)
                {
                    SwitchPlayer(PlayerOneGroupbox, PlayerTwoGroupbox);
                }
                else if (PlayerTwoGroupbox.Enabled == true)
                {
                    SwitchPlayer(PlayerTwoGroupbox, PlayerOneGroupbox);
                }
                _ticks = 0;
                RoundTimer.Start();
            }
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: ericsherlock/MathSkillsGame
        }//End Form1

        //Method BeginGame Sets Up All Variables For Game Or Round
        public void BeginGame()
        {
            //Declaring Necessary Variables
            int m = 0, n = 0, x = 0, y = 0, a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, t = 0, s = 0;

            //If Else Loops To Make The Game Harder Based On Current Score
            if (totalscore <= 300)
            {
                LevelLabel.Text = "Easy";
                //Addition / Subtraction bounds
                m = -20;
                n = 50;
                //Multiplication Bounds
                x = -10;
                y = 10;
                //Division Bounds
                t = -20;
                s = 100;
                a = 1;
                b = 10;
                //Mod Bounds
                c     = 1;
                d     = 50;
                e     = 1;
                f     = 10;
                rtime = 60;
            }
            else if ((totalscore > 300) && (totalscore <= 600))
            {
                LevelLabel.Text = "Medium";
                //Addition / Subtraction Bounds
                m = -50;
                n = 500;
                //Multiplication Bounds
                x = -15;
                y = 15;
                //Division Bounds
                t = -20;
                s = 150;
                a = 1;
                b = 15;
                //Mod Bounds
                c     = 10;
                d     = 100;
                e     = 10;
                f     = 20;
                rtime = 45;
            }
            else if ((totalscore > 600) && (totalscore <= 1000))
            {
                LevelLabel.Text = "Hard";
                //Addition / Subtraction Bounds
                m = -100;
                n = 1000;
                //Multiplication Bounds
                x = -25;
                y = 25;
                //Division Bounds
                t = -100;
                s = 500;
                a = 1;
                b = 50;
                //Mod Bounds
                c     = 50;
                d     = 200;
                e     = 10;
                f     = 50;
                rtime = 30;
            }//End Levels If Else
            //Getting And Setting Random Number And Putting Them In Their Respective Labels
            ooanum          = randnum.Next(m, n);
            otanum          = randnum.Next(m, n);
            OOALabel.Text   = ooanum.ToString();
            OTALabel.Text   = otanum.ToString();
            aresult         = ooanum + otanum;
            oosnum          = randnum.Next(m, n);
            otsnum          = randnum.Next(m, n);
            sresult         = oosnum - otsnum;
            OOSLabel.Text   = oosnum.ToString();
            OTSLabel.Text   = otsnum.ToString();
            oomnum          = randnum.Next(x, y);
            otmnum          = randnum.Next(x, y);
            mresult         = oomnum * otmnum;
            OOMLabel.Text   = oomnum.ToString();
            OTMLabel.Text   = otmnum.ToString();
            oodnum          = randnum.Next(t, s);
            otdnum          = randnum.Next(a, b);
            dresult         = oodnum / otdnum;
            OODLabel.Text   = oodnum.ToString();
            OTDLabel.Text   = otdnum.ToString();
            oomodnum        = randnum.Next(c, d);
            otmodnum        = randnum.Next(e, f);
            modresult       = oomodnum % otmodnum;
            OOModLabel.Text = oomodnum.ToString();
            OTModLabel.Text = otmodnum.ToString();
            RTimeLabel.Text = rtime.ToString() + " seconds";
            RoundTimer.Start();
        }//End Begin Game
コード例 #5
0
 void StartTimer()
 {
     _ticks = 0;
     RoundTimer.Start();
 }