private async void RecordPopUpAsync(int delay) { WorldRecordPopUp.IsOpen = true; WorldRecordPopUp.Opacity = 0; await Task.Delay(delay); WorldRecordPopUp.VerticalOffset = PopUpBorder.ActualHeight / -2; WorldRecordPopUp.HorizontalOffset = PopUpBorder.ActualWidth / -2; WorldRecordPopUp.Opacity = 1; // Wenn Unsichtbar ist die Höhe Null, Bei Opacity 0 ist richtige Höhe verfügbar Ccontrol.IsEnabled = false; WRecordT1.Text = "Du hast deinen Persönlichen Rekord gebrochen"; RecordOldName.Text = "Alter Rekord:"; RecordOld.Text = Counter.GetFormatedCount(spielLogik.SpielOld.bestzeit); RecordNewName.Text = "Neuer Rekord:"; RecordNew.Text = Counter.GetFormatedCount(spielLogik.Spiel.bestzeit); Sounddesign.PlaySoundAsync(Sounddesign.RECORD); PopUpClose.Click += (sender, e) => { WorldRecordPopUp.IsOpen = false; Ccontrol.IsEnabled = true; }; }
// Game Ended private async void GameEndAsync() { Forward.Visibility = Visibility.Visible; Menu.Visibility = Visibility.Visible; if (popup == null) { popup = Spielende.GetPopUp(spiellogik, MoveToHighScore); BaseGrid.Children.Add(popup); } if (popup.IsOpen) { return; } popup.Opacity = 0; popup.IsOpen = true; await Task.Delay(10); popup.VerticalOffset = ((Border)popup.Child).ActualWidth / -2; popup.HorizontalOffset = ((Border)popup.Child).ActualHeight / -2; popup.Opacity = 1; Sounddesign.PlaySoundAsync(Sounddesign.GAME_COMPLETE); }
private void StarteSpiel(object sender, RoutedEventArgs e) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); Button btn = (Button)sender; if (sender == SpuzzleBtn) { this.Frame.Navigate(typeof(SchiebePuzzleOptions)); } else if (sender == KopfrechnenBTN) { this.Frame.Navigate(typeof(SpielSeite), new KopfrechnenController()); } else if (sender == MemorizeBTN) { this.Frame.Navigate(typeof(SpielSeite), new MemorizeController()); } else if (sender == ConcentrateBTN) { this.Frame.Navigate(typeof(SpielSeite), new ConcentrateController()); } else if (sender == WortGZahlBTN) { this.Frame.Navigate(typeof(SpielSeite), new FarbeGleichWortController()); } else if (sender == BuchstabenSalatBTN) { this.Frame.Navigate(typeof(SpielSeite), new BuchstabenController()); } else if (sender == WechselGeldBTN) { this.Frame.Navigate(typeof(SpielSeite), new WechselGeldController()); } }
public SpielSeite() { this.InitializeComponent(); volumeOn.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Collapsed : Visibility.Visible; volumeOff.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Visible : Visibility.Collapsed; Sounddesign.PlaySoundAsync(Sounddesign.GAME_START); }
private void Click(object sender, RoutedEventArgs e) { if (sender == credits) { Frame.Navigate(typeof(Credits)); return; } else if (sender == volumeOn || sender == volumeOff) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); Sounddesign.CycleAmbient(); volumeOn.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Collapsed : Visibility.Visible; volumeOff.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Visible : Visibility.Collapsed; return; } if (App.OFFLINE_MODE) { return; } Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH2); IsLogin = !IsLogin; ToggleAuswahl.IsChecked = true; ToggleAuswahl.Content = IsLogin ? "Login" : "Registrieren"; loginButton.Content = IsLogin ? "Login" : "Registrieren"; pwdConfirm.Visibility = IsLogin ? Visibility.Collapsed : Visibility.Visible; }
/* Musik ändern */ private void ChangeMusic() { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); Sounddesign.CycleAmbient(); volumeOn.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Collapsed : Visibility.Visible; volumeOff.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Visible : Visibility.Collapsed; }
public Credits() { this.InitializeComponent(); Sounddesign.PlaySoundAsync(Sounddesign.WOOSH); InitializeAsync(); Sounddesign.Ambient.Stop(); }
private async Task OnButtonPressedAsync() { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); if (CheckWin()) { return; } await SetNewButtonPositionsAsync(); }
/* Button Handler */ private void Click(object sender, RoutedEventArgs e) { if (sender.GetType().Equals(typeof(Button))) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); } else { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH2); } if (sender == tb1) { Difficulty(sender); } else if (sender == tb2) { Difficulty(sender); } else if (sender == tb3) { Difficulty(sender); } else if (sender == tbQuadratisch) { tbQuadratisch.Content = tbQuadratisch.IsChecked.Value ? "Quadratisch" : "Seitenverhältnis"; } else if (sender == volumeOff || sender == volumeOn) { ChangeMusic(); } else if (sender == EntferneBildBtn) { EntferneBild(); } else if (sender == NeuesBildBtn) { NeuesBildAsync(); } else if (sender == StarteSpielBtn) { StarteSpiel(); } else if (sender == Back) { Frame.Navigate(typeof(SpieleHub)); } else if (sender == Undo) { UndoActionAsync(); } else if (sender == Standard) { GetStandardBilder(); } }
private void Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); if (sender == Back) { Frame.Navigate(typeof(SpielSeite), spielLogik.spController); } if (sender == BackToMenu) { Frame.Navigate(typeof(SpieleHub)); } }
public SchiebePuzzleOptions() { this.InitializeComponent(); if (App.OFFLINE_MODE) { Standard.Visibility = Visibility.Collapsed; } App.currentPage = this; Sounddesign.PlaySoundAsync(Sounddesign.WOOSH); tb1.IsChecked = true; volumeOn.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Collapsed : Visibility.Visible; volumeOff.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Visible : Visibility.Collapsed; InitializeAsync(); }
private void Click(object sender, RoutedEventArgs e) { if (sender == Logout) { App.Abmelden(null); } else if (sender == volumeOn || sender == volumeOff) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); Sounddesign.CycleAmbient(); volumeOn.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Collapsed : Visibility.Visible; volumeOff.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Visible : Visibility.Collapsed; } }
public AnmeldeSeite() { this.InitializeComponent(); App.currentPage = this; Sounddesign.PlaySoundAsync(Sounddesign.WOOSH); volumeOn.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Collapsed : Visibility.Visible; volumeOff.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Visible : Visibility.Collapsed; if (!BuchstabenAufgabe.read) { BuchstabenAufgabe.ReadFile().GetAwaiter(); } if (App.OFFLINE_MODE) { ToggleAuswahl.IsEnabled = false; } }
private void Click(object sender, RoutedEventArgs e) { if (sender == Back) { Frame.Navigate(App.currentPage.GetType()); return; } Random rand = new Random(); Sound sound = null; switch (rand.Next(0, 15)) { case 0: sound = Sounddesign.BUTTON_PUSH1; break; case 1: sound = Sounddesign.BUTTON_PUSH2; break; case 2: sound = Sounddesign.LIST_SELECT1; break; case 3: sound = Sounddesign.GAME_START; break; case 4: sound = Sounddesign.PUZZLE_TILE_PUSH; break; case 5: sound = Sounddesign.PUZZLE_TILE_BLOCK; break; case 6: sound = Sounddesign.WOOSH; break; case 7: sound = Sounddesign.WOOSH_SMALL; break; case 8: sound = Sounddesign.WRONG1; break; case 9: sound = Sounddesign.WRONG2; break; case 10: sound = Sounddesign.RIGHT; break; case 11: sound = Sounddesign.GAME_COMPLETE; break; case 12: sound = Sounddesign.RECORD; break; case 13: sound = Sounddesign.RECORD_BIG; break; default: sound = Sounddesign.BUTTON_PUSH1; break; } Sounddesign.PlaySoundAsync(sound); }
private void Liste_SelectionChanged(object sender, SelectionChangedEventArgs e) { Border border = (Border)Liste.SelectedItem; if (border == null) { vorschaubild.Visibility = Visibility.Collapsed; vorschauText.Visibility = Visibility.Collapsed; } else { vorschaubild.Source = ((Image)border.Child).Source; vorschauText.Text = dateien[border].Name; vorschaubild.Visibility = Visibility.Visible; vorschauText.Visibility = Visibility.Visible; } Sounddesign.PlaySoundAsync(Sounddesign.LIST_SELECT1); }
private async void WorldRecordPopUpAsync(int delay) { WorldRecordPopUp.IsOpen = true; WorldRecordPopUp.Opacity = 0; await Task.Delay(delay); WorldRecordPopUp.VerticalOffset = PopUpBorder.ActualHeight / -2; WorldRecordPopUp.HorizontalOffset = PopUpBorder.ActualWidth / -2; WorldRecordPopUp.Opacity = 1; Ccontrol.IsEnabled = false; RecordOldName.Text = spielLogik.SpielOld.rekordhalter; RecordOld.Text = Counter.GetFormatedCount(spielLogik.SpielOld.globaleBestzeit); RecordNewName.Text = spielLogik.Spiel.rekordhalter; RecordNew.Text = Counter.GetFormatedCount(spielLogik.Spiel.globaleBestzeit); Sounddesign.PlaySoundAsync(Sounddesign.RECORD_BIG); PopUpClose.Click += Handler; }
private void Objekt_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) { e.Handled = true; moveOverlay.Visibility = Visibility.Collapsed; Point pos = moveOverlay.TransformToVisual(baseGrid).TransformPoint(new Point(0, 0)); bool found = false; for (int i = 0; i < aufgabe.wort.Length; i++) { Point container = eingabeContainer[i].TransformToVisual(baseGrid).TransformPoint(new Point(0, 0)); double w = eingabeContainer[i].Width / 2; double h = eingabeContainer[i].Height / 2; if (pos.X >= container.X - w && pos.X <= container.X + w && pos.Y >= container.Y - h && pos.Y <= container.Y + h) { if (eingabeContainer[i].Child != null) { Button button = eingabeContainer[i].Child as Button; eingabeContainer[i].Child = null; map[button].Child = button; } ((Border)tempButton.Parent).Child = null; eingabeContainer[i].Child = tempButton; found = true; break; } } if (!found) { ((Border)tempButton.Parent).Child = null; map[tempButton].Child = tempButton; } tempButton.Visibility = Visibility.Visible; Sounddesign.PlaySoundAsync(Sounddesign.PUTTING_DOWN); AktualisiereAufgabe(); }
private void AddSubCoin(Coins coin, bool add, bool SaveMove) { if (Finished) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); return; } if (!add && wechselgeld[coin] > 0) { wechselgeld[coin]--; } else if (add) { wechselgeld[coin]++; } else { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); return; } if (coin <= Coins.EUR_2) { Sounddesign.PlaySoundAsync(Sounddesign.COIN); } else { Sounddesign.PlaySoundAsync(Sounddesign.MONEY); } // Sinnlose Moves nicht speichern if (!SaveMove) { return; } //if (moves.Count != 0 && moves.Peek().coin == coin && moves.Peek().add != add) moves.Pop(); moves.Push(new Move(coin, add)); }
private void Click(object sender, RoutedEventArgs e) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); if (sender == Undo) { spiellogik.spController.Undo(); } else if (sender == PrevOb) { spiellogik.PrevObjekt(); } else if (sender == NextOb) { spiellogik.NextObjekt(); } else if (sender == Forward) { MoveToHighScore(); } else if (sender == Menu) { popup.IsOpen = !popup.IsOpen; } else if (sender == volumeOff || sender == volumeOn) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); Sounddesign.CycleAmbient(); volumeOn.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Collapsed : Visibility.Visible; volumeOff.Visibility = Sounddesign.CURRENT_AMBIENT == null ? Visibility.Visible : Visibility.Collapsed; } else if (sender == Back) { spiellogik.Cancel(); Frame.Navigate(previous.GetType()); } }
private void PivotItemLoadedSmall(Pivot sender, PivotItemEventArgs args) => Sounddesign.PlaySoundAsync(Sounddesign.WOOSH_SMALL);
public Spielende() { this.InitializeComponent(); Sounddesign.PlaySoundAsync(Sounddesign.WOOSH); }
private void LoginButton_Click(object sender, RoutedEventArgs e) { Sounddesign.PlaySoundAsync(Sounddesign.BUTTON_PUSH1); if (App.OFFLINE_MODE) { Nutzer.Getinstance(); this.Frame.Navigate(typeof(SpieleHub)); return; } // Prüfe Eingaben if (nickname.Text.Length < 3) { FehlerAusgabe.Text = "Nickname zu kurz. Min. 3 Zeichen"; return; } if (pwd.Password.Length < 6) { FehlerAusgabe.Text = "Passwort zu kurz. Min. 6 Zeichen"; return; } if (!IsLogin && !pwdConfirm.Password.Equals(pwd.Password)) { FehlerAusgabe.Text = "Passwörter stimmen nicht überein"; return; } if (logingIn) { return; } logingIn = true; WaitRing.IsActive = true; loginButton.IsEnabled = false; ToggleAuswahl.IsEnabled = false; nickname.IsEnabled = false; pwd.IsEnabled = false; pwdConfirm.IsEnabled = false; credits.IsEnabled = false; //Einloggen Request <Nutzer> request = null; string name = nickname.Text; string pass = pwd.Password; BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += (s, e1) => { request = Nutzer.Einloggen((IsLogin ? App.FUNCTION_LOGIN : App.FUNCTION_REGISTER), name, pass).GetAwaiter().GetResult(); if (request != null && request.Success) { SpielHighscores.HoleHighscoresAsync().GetAwaiter(); } }; bw.RunWorkerCompleted += (s, e1) => Login(request); bw.RunWorkerAsync(); }
private void Objekt_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e) { e.Handled = true; tempButton.Visibility = Visibility.Collapsed; Sounddesign.PlaySoundAsync(Sounddesign.PUTTING_DOWN); }
private async Task OnDecoyPressedAsync() { Sounddesign.PlaySoundAsync(Sounddesign.WRONG2); base.AddTimePenalty(); await SetNewButtonPositionsAsync(); }