Beispiel #1
0
        private void LeftBrokenAdd()
        {
            EggWay.Add(new Image());
            EggWay[FallFrameIndex].Source = new BitmapImage(
                new Uri("pack://application:,,,/Resources/ChickenLeft/BrokenEggLeft.png"));
            EggWay[FallFrameIndex].Stretch    = Stretch.Fill;
            EggWay[FallFrameIndex].Visibility = Visibility.Hidden;

            for (int i = FallFrameIndex + 1; i < EndOfWayIndex; i++)
            {
                EggWay.Add(new Image());
                EggWay[i].Source = new BitmapImage(
                    new Uri($"pack://application:,,,/Resources/ChickenLeft/ChickenLeftPos{i - FallFrameIndex}.png"));

                EggWay[i].Stretch    = Stretch.Fill;
                EggWay[i].Visibility = Visibility.Hidden;
            }
        }
Beispiel #2
0
 private void EggGenerate(string location, string expansion)
 {
     for (int i = 0; i < FallFrameIndex; i++)
     {
         EggWay.Add(new Image());
         EggWay[i].Source = new BitmapImage(
             new Uri(location + (i + 1) + expansion));
         EggWay[i].Stretch    = Stretch.Fill;
         EggWay[i].Visibility = Visibility.Hidden;
     }
     if (SpawnPos == Position.LeftTop || SpawnPos == Position.LeftBottom)
     {
         LeftBrokenAdd();
     }
     else
     {
         RightBrokenAdd();
     }
 }