I am developing a game, where we have a spaceship, rockets, and some picture boxes showing the enemy. The goal is to kill the enemy with rockets.
I used this code for the picture boxes but this won't make a good result.
foreach (Control element in ptb_backGround.Controls)
{
if (element is PictureBox && element.Name != "ptb_spaceShip")
{
Image enimisPic = Properties.Resources.Alien_displeased_icon;
element.BackColor = Color.Transparent;
ptb_backGround.Controls.Add(element);
element.BackgroundImage = enimisPic;
element.BackgroundImageLayout = ImageLayout.Stretch;
}
}