Beispiel #1
0
        static void Main(string[] args)
        {
            Console.Clear();
            Console.CursorVisible = false;
            GameMenu defaultSettings = new GameMenu();

            defaultSettings.PrintMenu();
            ConsoleKey keypressed;

            do
            {
                keypressed = Console.ReadKey(true).Key;
                defaultSettings.SettingAction(keypressed);
            } while (keypressed != ConsoleKey.Enter);
            Game newGame = new Game(defaultSettings.PorposedHorizontalTiles, defaultSettings.PorposedVerticalTiles, defaultSettings.PorposedBombAmount, defaultSettings.PorposedCoverColour,
                                    defaultSettings.PorposedCoverSecondaryColour, defaultSettings.PorposedUncoverColour, defaultSettings.PorposedUncoverSecondaryColour, defaultSettings.PorposedFlagColour,
                                    defaultSettings.PorposedHighlightColour, defaultSettings.PorposedTextColour);

            for (int x = 0; x < newGame.HorizontalTiles; x++)
            {
                for (int y = 0; y < newGame.VerticalTiles; y++)
                {
                    newGame.Minefield[x, y].MinesAndTilesAroundCalculator(x, y, newGame.Minefield);
                }
            }
            Console.Clear();
            newGame.PrintMinefield();
            do
            {
                keypressed = Console.ReadKey(true).Key;
                newGame.GameAction(keypressed);
                if (newGame.UncoveredTiles == newGame.TilesWithoutMines)
                {
                    newGame.WinGame();
                }
            } while (newGame.GameFinished == false);
        }
Beispiel #2
0
        private void pbSettings_Click(object sender, EventArgs e)
        {
            GameMenu gm = new GameMenu();

            gm.ShowDialog();
        }