Exemplo n.º 1
0
        private void EndGame(bool TimeIsUp)
        {
            //stop all timers/stopwatches
            tmrStopwatch.Stop();
            tmrAnimation.Stop();
            Stopwatch.Stop();

            //check to see if this score made the leaderboards
            TopScoreCheck();

            //show message saying game is done
            if (TimeIsUp)
            {
                MessageBox.Show("Time is up! Let's see if you made it to the leaderboard:", "Game Finished");
            }
            else
            {
                MessageBox.Show("No more possible moves left. Let's see if you made it to the leaderboard:", "Game Over");
            }

            //make and show leaderboards form, making this form invisible while the new one is open
            frmLeaderboards LeaderBoards = new frmLeaderboards();

            LeaderBoards.ShowDialog();
            LeaderBoards.Dispose();
            GameIsOver = true; //prevents "Are you sure you want to quit" dialog from showing
            this.Close();
        }
Exemplo n.º 2
0
        private void btnHighScore_Click(object sender, EventArgs e)
        {
            //make and show leaderboards form, making this form invisible while the new one is open
            frmLeaderboards LeaderBoards = new frmLeaderboards();

            this.Visible = false;
            LeaderBoards.ShowDialog();
            LeaderBoards.Dispose();
            this.Visible = true;
        }