Пример #1
0
        public void Add()
        {
            if (empty_queue.Count() >= 1)
            {
                int         i      = empty_queue.Dequeue();
                Image       en     = new Image();
                BitmapImage bimage = new BitmapImage();
                bimage.BeginInit();
                bimage.UriSource = new Uri("enemy.png", UriKind.Relative);
                bimage.EndInit();
                en.Source = bimage;
                Thickness mov = new Thickness(ran.Next(-600, 600), ran.Next(-800, -700), 0, 0);

                en.Margin = mov;
                en.Width  = 60;
                en.Height = 60;
                background.Children.Add(en);
                childrens_bullets[i] = new Bullets(background, en);
                childrens[i]         = new Enemy(2, 2, en, childrens_bullets[i], player, background, i);
            }
        }
Пример #2
0
 public Bullet(Grid back, int t, Bullets f)
 {
     tag        = t;
     father     = f;
     background = back;
 }