Ejemplo n.º 1
0
        private void Tick(object sender, EventArgs e)
        {
            Player1TimeLabel.Text = player1Time.GetTimeString();
            Player2TimeLabel.Text = player2Time.GetTimeString();

            if (!player1Time.isValid() || !player2Time.isValid())
            {
                string winner = player1Time.isValid() ? "White" : "Black";
                WinnerLabel.Text           = string.Format("Congratulations! {0} won the game!", winner);
                WinnerLabel.Visible        = true;
                SwitchPlayerButton.Visible = false;
                StartStopButton.Visible    = false;
                player1Time.Stop();
                player2Time.Stop();
            }
        }
Ejemplo n.º 2
0
        private void button_second_player_Clicked(object sender, EventArgs e)
        {
            Sound.PlaySound(Sound.SoundType.KickClap);
            playerTimer2.Stop();
            button_second_player.IsEnabled = false;
            playerTimer2.AddTime();

            row0.Height = new GridLength(4, GridUnitType.Star);
            row1.Height = new GridLength(6, GridUnitType.Star);

            playerTimer1.Start();
            button_first_player.IsEnabled = true;
        }