Beispiel #1
0
        //Upon clicking "Back"
        private void Back_Click(object sender, EventArgs e)
        {
            //Creates and opens new StartMenu
            var startMenu = new StartMenu(settings);

            startMenu.Closed += (s, args) => this.Close();
            startMenu.Show();
            //Allows a pause for the form to open in the background so that the screen doesn't flash
            Thread.Sleep(20);
            this.Hide();
        }
Beispiel #2
0
        static void Main()
        {
            //SETTINGS STRUCT
            //Used to pass setting variables between menus and game
            StartMenu.GameSettings settings = new StartMenu.GameSettings();


            //Create and run the menu form
            SMenu = new StartMenu(settings);
            Application.Run(SMenu);

            //If start game was pressed
            if (settings.isGameCreated)
            {
                //Create and run the game
                TronGame newGame = new TronGame(settings.num, settings.Colours, settings.Names);
                newGame.Run();
            }
        }