1

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;
    }
}

Screenshot, with a placeholder / rectangle
enter image description here

Screenshot, with the actual image
enter image description here

Kai Brummund
  • 3,538
  • 3
  • 23
  • 33
amir
  • 11
  • 1

1 Answers1

0

I had this problem once too and i tried many solutions, They al worked form me but the did flicker when moving. except this with this control.

But I would not use forms is not suitable for making games. I would use XNA or Unity if I were you

I hope I have solved your problem

Community
  • 1
  • 1
Pepernoot
  • 3,409
  • 3
  • 21
  • 46