예제 #1
0
        private void FlappyBirdForm_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == ' ' && !dead)
            {
                SoundPlayer player = new SoundPlayer(path_jump_sound);
                player.Play();

                miliseconds = 0;
                GravityTimer.Stop();
                JumpTimer.Start();
            }
        }
예제 #2
0
        private void GameOver()
        {
            SoundPlayer player = new SoundPlayer(path_die_sound);

            player.Play();

            GravityTimer.Stop();
            dead    = true;
            gravity = 0;

            HighScores();

            ScoreWindow window = new ScoreWindow(Score);

            window.Show();

            this.Close();
        }