コード例 #1
0
        /// <summary>
        /// The method goes to the starting screen and removes the current user and closes the menu
        /// </summary>
        private void btnLogOut_Click(object sender, EventArgs e)
        {
            CurrentUser.Clear();
            this.Hide();
            var window = new StartingScreen();

            window.ShowDialog();
            this.Close();
        }
コード例 #2
0
ファイル: Instructions.cs プロジェクト: kochsj/Minesweeper
        public static void InstructionHandler()
        {
            StartingScreen.EraseStartingScreen();

            PrintInstructions();

            EraseInstructions();

            StartingScreen.PrintStartingScreen();
        }
コード例 #3
0
    void Start()
    {
        instance = this;

        _blackScreen = GetComponent <Image>();
        if (_blackScreen != null)
        {
            _blackScreen.color = new Color(_blackScreen.color.r, _blackScreen.color.g, _blackScreen.color.b, 1);
            IEnumerator coroutine = Fade(true);
            StartCoroutine(coroutine);
        }
    }
コード例 #4
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            StartingScreen startingScreen = new StartingScreen();

            startingScreen.Show();
        }
コード例 #5
0
        public static void Main()
        {
            startTime = DateTime.Now;
            StartingScreen.PrintStartingScreen();

            string boardSizeSelection = StartingScreen.ManageStartingScreen();

            bool isPlaying = true;
            bool winner    = false;

            BoardState.InitializeBoardState(boardSizeSelection);
            //Matrix.PrintMatrix();

            while (isPlaying == true)
            {
                string tileChoice = UserSelection.SelectTile();

                if (tileChoice != "marked")
                {
                    var squaresToModify = SquareCheck.SquareCheckHandler(tileChoice);

                    foreach (var tile in squaresToModify)
                    {
                        if (tile.Value == Tiles.BombTile())
                        {
                            isPlaying = false;
                        }
                    }

                    BoardState.UpdateTheBoardState(squaresToModify);
                }

                bool wonGame = WinCondition.CheckWinCondition(BoardState.gameboardSize);
                if (wonGame)
                {
                    winner    = true;
                    isPlaying = false; Console.WriteLine("YOU WIN!!!!");
                }
            }
            GameOver.PrintGameOver();

            bool deciding = true;

            while (deciding)
            {
                Console.WriteLine("Would you like to play again? (y/n)");
                string response = Console.ReadLine();

                if (winner)
                {
                    UserSelection.ClearCurrentConsoleLine(Console.CursorTop, 3);
                }
                else
                {
                    UserSelection.ClearCurrentConsoleLine(Console.CursorTop, 2);
                }

                if (response.ToLower() == "y")
                {
                    deciding = false;
                    GameOver.EraseGameOver();
                    BoardState.EraseTheBoard();
                    Main();
                }
                if (response.ToLower() == "n")
                {
                    return;
                }
            }
        }