public void selectPlayer2() { player2IsAvailable = PlayerPrefs.GetInt("Player2", 0); if (player2IsAvailable == 1) { currentPlayer = 2; Click.Play(); PlayerPrefs.SetInt("Player", 2); Player1BtnTXT.text = "1"; Player2BtnTXT.text = "USED"; } else if (player2IsAvailable == 0) { if (MyCoin >= 300) { Buy.Play(); MyCoin = MyCoin - 300; PlayerPrefs.SetInt("Player2", 1); Player2BtnTXT.text = "USE"; player2IsAvailable = PlayerPrefs.GetInt("Player2", 0); } else { Wrong.Play(); StartCoroutine(NotificationFailed()); } } }
private void Ok_Click(object sender, RoutedEventArgs e) { path = "//TestFinal/Probleme" + CurrentQuestion; r = monFichier.SelectSingleNode(path + "/R"); int res = int.Parse(r.InnerText); Next.IsEnabled = true; if (res == rep) { Correct.Position = TimeSpan.Zero; Correct.Play(); score++; } else { Wrong.Position = TimeSpan.Zero; Wrong.Play(); } if (res == 1) { t1.Visibility = Visibility.Visible; t2.Visibility = Visibility.Hidden; t3.Visibility = Visibility.Hidden; f2.Visibility = Visibility.Visible; f1.Visibility = Visibility.Hidden; f3.Visibility = Visibility.Visible; } if (res == 2) { t2.Visibility = Visibility.Visible; t1.Visibility = Visibility.Hidden; t3.Visibility = Visibility.Hidden; f1.Visibility = Visibility.Visible; f2.Visibility = Visibility.Hidden; f3.Visibility = Visibility.Visible; } if (res == 3) { t3.Visibility = Visibility.Visible; t2.Visibility = Visibility.Hidden; t1.Visibility = Visibility.Hidden; f2.Visibility = Visibility.Visible; f3.Visibility = Visibility.Hidden; f1.Visibility = Visibility.Visible; } }
private void Abgabe_Click(object sender, RoutedEventArgs e) { abgabebtn.IsEnabled = false; Antwort.IsReadOnly = true; Antwort.Focusable = false; if (Controller.Stufen[Controller.currentGrade].checksSolution(Antwort.Text, out string _lösung)) { Lösung.Text = "Richtig!"; Lösung.Foreground = new SolidColorBrush(Colors.LawnGreen); if (SettingsWindow.IsSoundOn) { Right.Play(); } if (ChallengeMode) { Controller.UpdateChallengeData(); switch (Controller.currentGrade) { case "Grundschule": Controller.UpdateLevel(1.3f); break; case "Mittelstufe": Controller.UpdateLevel(1.5f); break; case "Oberstufe": Controller.UpdateLevel(2f); break; } } else { Controller.UpdateLevel(); } } else { Lösung.Text = "Falsch!" + Environment.NewLine + _lösung; Lösung.Foreground = new SolidColorBrush(Colors.Red); if (SettingsWindow.IsSoundOn) { Wrong.Play(); } } if (ChallengeMode) { timer.CancelAsync(); --ChallengeVersuche; if (ChallengeVersuche <= 0) { ChallengeMode = false; ChallengeVersuche = 10; NavigationService.Navigate(new challengeAuswahl()); } } NextExerciseButton.Opacity = 100; NextExerciseButton.IsEnabled = true; }
public void BuyGrape() { if (grape == 0) { if (MyCoin >= 150) { Buy.Play(); MyCoin = MyCoin - 150; GrapeBtnTXT.text = "SOLD"; PlayerPrefs.SetInt("tier3", 1); PlayerPrefs.SetInt("Coin", MyCoin); grape = PlayerPrefs.GetInt("tier3", 0); } else { Wrong.Play(); StartCoroutine(NotificationFailed()); } } }
public void BuyCherry() { if (cherry == 0) { if (MyCoin >= 300) { Buy.Play(); MyCoin = MyCoin - 300; CherryBtnTXT.text = "SOLD"; PlayerPrefs.SetInt("tier2", 1); PlayerPrefs.SetInt("Coin", MyCoin); cherry = PlayerPrefs.GetInt("tier2", 0); } else { Wrong.Play(); StartCoroutine(NotificationFailed()); } } }
public void BuyApple() { if (apple == 0) { if (MyCoin >= 50) { MyCoin = MyCoin - 50; AppleBtnTXT.text = "SOLD"; Buy.Play(); PlayerPrefs.SetInt("tier1", 1); PlayerPrefs.SetInt("Coin", MyCoin); apple = PlayerPrefs.GetInt("tier1", 0); } else { Wrong.Play(); StartCoroutine(NotificationFailed()); } } }