コード例 #1
0
ファイル: Ennemi.cs プロジェクト: GuempelR/enigmos
        //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);
        }