Exemple #1
0
        protected void GameClear()
        {
            if (!run)
            {
                return;
            }
            gameTimer.Stop();
            itemTimer.Stop();
            itemConTimer.Stop();
            MessageBox.Show("스테이지 클리어!");
            if (Convert.ToInt32(mapId) >= 15)
            {
                MessageBox.Show("마지막 스테이지입니다!");
                // hide main form
                this.Hide();

                // show other form
                SelectStage selectStage = new SelectStage();
                selectStage.Location = this.Location;
                selectStage.ShowDialog();

                // close application
                this.Close();
            }
            else
            {
                DialogResult result = MessageBox.Show("다음 스테이지로 넘어가시겠습니까?", "GameClear", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    // hide main form
                    this.Hide();

                    // show other form
                    StageMode stageMode = new StageMode();
                    StageMode.formName = "StageMode";
                    StageMode.mapId    = (Convert.ToInt32(mapId) + 1).ToString();
                    stageMode.Location = this.Location;
                    stageMode.ShowDialog();

                    // close application
                    //this.Close();
                }
                else
                {
                    // hide main form
                    this.Hide();

                    // show other form
                    SelectStage selectStage = new SelectStage();
                    selectStage.Location = this.Location;
                    selectStage.ShowDialog();

                    // close application
                    this.Close();
                }
            }
        }
Exemple #2
0
        private void BtnStage_Click(object sender, EventArgs e)
        {
            this.Close();
            for (int i = 0; i < 15; i++)
            {
                if ((Button)sender == stageBtns[i])
                {
                    StageMode.mapId = (i + 1).ToString();
                    break;
                }
            }
            // hide main form
            this.Hide();

            // show other form
            StageMode stageMode = new StageMode();

            StageMode.formName = "StageMode";
            stageMode.ShowDialog();
            stageMode.Location = this.Location;

            // close application
            this.Close();
        }