Ejemplo n.º 1
0
        private void CallGameMenu()
        {
            PauseGame();
            timer4.Stop();

            Esc_menu_background.Visible = true;
            Esc_menu_background.BringToFront();
            Restart_button.Visible = true;
            Restart_button.BringToFront();
            Esc_continue_button.Visible = true;
            Esc_continue_button.BringToFront();
            exit_button.Visible = true;
            exit_button.BringToFront();
        }
Ejemplo n.º 2
0
        private void GameOver()
        {
            timer2.Stop();
            timer1.Stop();

            GameOver_Label.Visible = true;
            GameOver_Label.BringToFront();
            Restart_button.Visible = true;
            Restart_button.BringToFront();
            exit_button.Visible = true;
            exit_button.BringToFront();

            ////////////////////////////////////////////////////////////
            GamersResults_button.Left   += 7;
            GamersResults_button.Top    += 35;
            GamersResults_button.Visible = true;
            GamersResults_button.BringToFront();
            ////////////////////////////////////////////////////////////

            Program.ResultsTable = new ResultsTable(Program.Information.ReadGamersResults(), Program.Information.ReadGamerNames());

            if (Program.GamerScore == 0)
            {
                for (int i = 0; i < Program.NumberOfWinnersPlaces; i++)
                {
                    if (Program.ResultsTable.PlacesNames[i] == "Пусто")
                    {
                        Program.GamerPlace = i;

                        //if number == 1 this ↓ will create Form "AskGamerNameForm", and if number == 2 this ↓ will create Form "gamersResultsTableForm", for more information read class CreateNewForm
                        CreateNewForm nameForm = new CreateNewForm(1);
                        break;
                    }
                }
            }
            else
            {
                for (int i = 0; i < Program.ResultsTable.PlacesScores.Length; i++)
                {
                    if (Program.GamerScore > Program.ResultsTable.PlacesScores[i])
                    {
                        Program.GamerPlace = i;

                        //if number == 1 this ↓ will create Form "AskGamerNameForm", and if number == 2 this ↓ will create Form "gamersResultsTableForm", for more information read class CreateNewForm
                        CreateNewForm nameForm = new CreateNewForm(1);
                        break;
                    }
                    else if (Program.GamerScore == Program.ResultsTable.PlacesScores[i])
                    {
                        if (i < Program.ResultsTable.PlacesScores.Length - 1)
                        {
                            Program.GamerPlace = i + 1;

                            //if number == 1 this ↓ will create Form "AskGamerNameForm", and if number == 2 this ↓ will create Form "gamersResultsTableForm", for more information read class CreateNewForm
                            CreateNewForm nameForm = new CreateNewForm(1);
                            break;
                        }
                    }
                }
            }
        }