Esempio n. 1
0
        //Nový začátek hry
        private void BAgain_Click(object sender, EventArgs e)
        {
            KeyDown   += KeyPressed;
            KeyUp     += KeyReleased;
            GameEnded += EndGame;
            BAgain.Hide();
            BQuit.Hide();
            loseLabel.Hide();
            winLabel1.Hide();
            winLabel2.Hide();
            finalScoreLabel.Hide();

            Focus();
            g.Start();
        }
Esempio n. 2
0
        //Konec hry
        private void EndGame(object sender, EndGameEventArgs e)
        {
            KeyUp     -= KeyReleased;
            KeyDown   -= KeyPressed;
            GameEnded -= EndGame;

            BAgain.Show();
            BQuit.Show();
            finalScoreLabel.Text = "Score: " + e.Score;
            finalScoreLabel.Show();

            if (e.Win)
            {
                winLabel1.Show();
                winLabel2.Show();
            }
            else
            {
                loseLabel.Show();
            }
        }