Esempio n. 1
0
        //-------------------------------------------------------------------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------------------------------------------------------------------


        //-------------------------------------------------------------------------------------------------------------------------------------------
        //                                           METHOD FOR QUITTING THE GAME THROUGH THE EXIT BUTTON
        //-------------------------------------------------------------------------------------------------------------------------------------------

        private void gameEnd()
        {
            // show messsage that the player has chosen to exit the game
            MessageBox.Show("You have chosen to exit the appplication");
            //close the form
            Application.Exit();
            //stop playing the background music
            backMusic.stop();
        }
Esempio n. 2
0
        //-------------------------------------------------------------------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------------------------------------------------------------------


        //-------------------------------------------------------------------------------------------------------------------------------------------
        //                                          EVENT HANDLERS FOR THE START, HELP, AND EXIT BUTTONS
        //-------------------------------------------------------------------------------------------------------------------------------------------

        private void HelpBtn_Click(object sender, EventArgs e)
        {
            // hide the help button when the help button is clicked
            helpBtn.Hide();
            // hide the exit button when the help button is clicked
            exitBtn.Hide();
            //change the location fo the start button
            startBtn.Location = new Point(140, 500);
            //change the background image
            BackgroundImage = Image.FromFile(Application.StartupPath + @"\inBack.jpg", true);
            //stop the timer
            refresh.Stop();
            //stops the shooting sound
            shootSound.stop();
        }