Пример #1
0
        //Génére un ennemi
        public static Ennemi CreateEnnemi(EnigmaPanel panel, PictureBox pbxGround, List<Ennemi> listEnnemi)
        {
            Ennemi pbxEnnemi = new Ennemi();
            pbxEnnemi.Size = new Size(70, 80);
            pbxEnnemi.Size = Properties.Resources.ennemi1.Size;

            if (pbxEnnemi.direction == Direction.DROITE)
            {
                pbxEnnemi.Location = new Point(pbxGround.Left, pbxGround.Top - pbxEnnemi.Height);
            }
            else if (pbxEnnemi.direction == Direction.GAUCHE)
            {
                pbxEnnemi.Location = new Point(pbxGround.Right - pbxEnnemi.Width, pbxGround.Top - pbxEnnemi.Height);
            }

            pbxEnnemi.BackColor = Color.Transparent;
            pbxEnnemi.Image = Properties.Resources.ennemi1;
            panel.Controls.Add(pbxEnnemi);

            listEnnemi.Add(pbxEnnemi);

            return pbxEnnemi;
        }
Пример #2
0
        //Génére un ennemi
        public static Ennemi CreateEnnemi(EnigmaPanel panel, PictureBox pbxGround, List <Ennemi> listEnnemi)
        {
            Ennemi pbxEnnemi = new Ennemi();

            pbxEnnemi.Size = new Size(70, 80);
            pbxEnnemi.Size = Properties.Resources.ennemi1.Size;

            if (pbxEnnemi.direction == Direction.DROITE)
            {
                pbxEnnemi.Location = new Point(pbxGround.Left, pbxGround.Top - pbxEnnemi.Height);
            }
            else if (pbxEnnemi.direction == Direction.GAUCHE)
            {
                pbxEnnemi.Location = new Point(pbxGround.Right - pbxEnnemi.Width, pbxGround.Top - pbxEnnemi.Height);
            }

            pbxEnnemi.BackColor = Color.Transparent;
            pbxEnnemi.Image     = Properties.Resources.ennemi1;
            panel.Controls.Add(pbxEnnemi);

            listEnnemi.Add(pbxEnnemi);

            return(pbxEnnemi);
        }