예제 #1
0
        private void SetName(object sender, RoutedEventArgs e)
        {
            if (NamePlayer.Text.Length == 0)
            {
                return;
            }
            config.SetPlayerName(NamePlayer.Text);
            win.EnableTimer = (Boolean)EnableTimer.IsChecked;
            switch (config.GetLevel())
            {
            case "1":
                View.RedirectUrl("FirstLevel.xaml");
                break;

            case "2":
                View.RedirectUrl("SecondLevel.xaml");
                break;

            case "3":
                View.RedirectUrl("ThirdLevel.xaml");
                break;

            default: break;
            }
            var w = Application.Current.Windows.OfType <MainWindow>().First();

            w.Player.Text += config.GetPlayerName();
        }
예제 #2
0
 void TimerTick(object sender, EventArgs e)
 {
     Seconds--;
     TimerText.Text = Seconds.ToString();
     if (Seconds == 0)
     {
         Score          = 0;
         ScoreGame.Text = "Очки: ";
         Timer.Stop();
         Seconds             = 300;
         TimerText.Text      = Seconds.ToString();
         MainMenu.Visibility = Visibility.Collapsed;
         View.RedirectUrl("Login.xaml");
     }
 }
예제 #3
0
        private void NextLevel(object sender, RoutedEventArgs e)
        {
            switch (config.GetLevel())
            {
            case "1":
                View.RedirectUrl("SecondLevel.xaml");
                break;

            case "2":
                View.RedirectUrl("ThirdLevel.xaml");
                break;

            case "3": break;

            default: break;
            }
        }
예제 #4
0
        private void Ellipse_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var el = (sender as Label);

            if (el.Opacity == 1)
            {
                return;
            }
            if (win.ToolTipSound)
            {
                win.spLabel.Play();
            }
            el.Opacity = 1;
            Finded++;
            FindedText.Text    = Finded.ToString();
            Progress.Value     = Finded;
            win.Score         += 100;
            win.ScoreGame.Text = "Очки " + win.Score.ToString();
            if (Finded == 6)
            {
                win.Timer.Stop();
                View.RedirectUrl("Midlle.xaml");
            }
        }