public List <Dictionary <String, int> > getLevelUpgrades() { for (int i = 1; i < noOfLevels; i++) { Dictionary <String, int> level = new Dictionary <String, int>(); level.Add("NextLevelScore", 100 * i); level.Add("PointLevel", 10 * i); level.Add("Level", i); //level.Add("Speed", 2*i); // blinkness = max 7 for last level level.Add("Color", GenerateSize.Next(colors.Count)); levelUpgrades.Add(level); } return(levelUpgrades); }
private void GoHome(object sender, RoutedEventArgs e) { Stop(sender, e); Intro.Visibility = Visibility.Visible; PauseButton.Visibility = Visibility.Collapsed; ResetButton.Visibility = Visibility.Collapsed; NextLevelButton.Visibility = Visibility.Collapsed; HomeButton.Visibility = Visibility.Collapsed; PlayButton.Visibility = Visibility.Visible; GameOver.Visibility = Visibility.Collapsed; NextLevel.Visibility = Visibility.Collapsed; getSettingsForLevel(1); lives = 5; int numberOfScores = colors.Count; Chosen = GenerateSize.Next(colors.Count); levelColor = colors[Chosen]; ColorButton.Foreground = levelColor; ColorButton.BorderBrush = levelColor; ColorButton.Background = levelColor; levelScoreButtom.Margin = new Thickness(this.ActualWidth * 3 / 4, 15, 0, 0); levelScoreButtom.Visibility = Visibility.Collapsed; levelScoreButtom.FontSize = 14; levelScoreButtom.Foreground = levelColor; levelScoreButtom.Text = "Score:" + 0; livesDisplay.Margin = new Thickness(this.ActualWidth * 3 / 4, 30, 0, 0); livesDisplay.Foreground = levelColor; livesDisplay.Visibility = Visibility.Collapsed; livesDisplay.FontSize = 14; livesDisplay.Text = "Lives:" + lives; CurrentlevelButton.Foreground = levelColor; CurrentlevelButton.Margin = new Thickness(this.ActualWidth * 3 / 4, 45, 0, 0); CurrentlevelButton.Visibility = Visibility.Collapsed; CurrentlevelButton.FontSize = 14; CurrentlevelButton.Text = "Level:" + 0; ScoreBoard.Children.Add(levelScoreButtom); ScoreBoard.Children.Add(livesDisplay); ScoreBoard.Children.Add(CurrentlevelButton); }