示例#1
0
        private void StartButton_Click(object sender, EventArgs e)
        {
            string level = "level_1";

            startButton.Enabled = false;
            if (Hardmode.Checked == true)
            {
                health     = 1;
                lives.Text = "1";
            }
            else
            {
                health     = 3;
                lives.Text = "3";
            }
            Hardmode.Enabled    = false;
            levelPicker.Enabled = false;
            switch (levelPicker.SelectedIndex)
            {
            case 0: level = "level_1"; break;

            case 1: level = "level_2"; break;

            case 2: level = "level_3"; break;

            case 3:
                level      = "level_4";
                health     = 1;
                lives.Text = "1";
                MessageBox.Show("Tohle je super těžký level, na který je pouze jeden život.", "Hardcore^2", MessageBoxButtons.OK);
                break;
            }

            Map.LoadMap(@"..\..\Resources\" + level + ".txt");
            Print();

            yellowMonstrum.BringToFront();
            purpleMonstrum.BringToFront();
            blueMonstrum.BringToFront();
            pacman.BringToFront();

            Music.SoundLocation = @"..\..\Resources\ChocolateRain.wav";
            Music.Play();

            movement.Start();
        }