コード例 #1
0
        public void GameOver()
        {
            if (dist > maxDist)
            {
                maxDist = dist;                 // if you broke record, replace it
            }
            xmlSave();
            gameTimer.Stop(); // stop doing things

            if (coinScore >= 0)
            {
                revivePopup.dist = (int)(dist / 100);   //sets the dist you travelled
                revivePopup rp = new revivePopup();     //then opens a new popup
                rp.Location = this.FindForm().Location; // places in proper loc
                DialogResult result = rp.ShowDialog();  //show

                if (result == DialogResult.Yes)         // if revive button pushed,
                {
                    gameTimer.Enabled = true;           // renable timer
                    backgroundMoveSpd = spdStorage;     // restore spd
                    timeBtwnLasers    = 120;            // reset this
                    coinScore        -= 250;            // remove coins
                    endGame           = false;          // reset
                    lasers.Clear();                     //reset
                }
                else if (result == DialogResult.No)     // if shop button
                {
                    Form1.switchScreen(this, "shop");   //switch to shop
                    actualDist = 0;                     //reset dist
                    dist       = 0;
                }
                else if (result == DialogResult.OK) // obselete
                {
                    ShopScreen.switchS = true;
                    Form1.switchScreen(this, "shop");

                    dist       = 0;
                    actualDist = 0;
                }
                else if (result == DialogResult.Abort)
                {
                    FindForm().Close(); // close game
                }
                music.Stop();
            }
            else //obselete
            {
                Form1.switchScreen(this, "shop");
            }
        }
コード例 #2
0
        public void GameOver()
        {
            if (dist > maxDist)
            {
                maxDist = dist;
            }
            xmlSave();
            gameTimer.Stop();

            if (coinScore >= 0)
            {
                revivePopup rp = new revivePopup();
                rp.Location = this.FindForm().Location;
                DialogResult result = rp.ShowDialog();

                if (result == DialogResult.Yes)
                {
                    gameTimer.Enabled = true;
                    backgroundMoveSpd = spdStorage;
                    timeBtwnLasers    = 120;
                    coinScore        -= 250;
                    endGame           = false;
                    lasers.Clear();
                }
                else if (result == DialogResult.No)
                {
                    Form1.switchScreen(this, "shop");
                    actualDist = 0;
                    dist       = 0;
                }
                else if (result == DialogResult.OK)
                {
                    ShopScreen.switchS = true;
                    Form1.switchScreen(this, "shop");

                    dist       = 0;
                    actualDist = 0;
                }
            }
            else
            {
                Form1.switchScreen(this, "shop");
            }
        }