Beispiel #1
0
 //destroys picturebox so new game can be started, also used to show who won images
 public void destroy_Grid()
 {
     if (makeGame.hasWon() != USER)
     {
         for (int loopnum = playerATKPanel.Controls.Count - 1; loopnum >= 0; loopnum--)
         {
             if (playerATKPanel.Controls[loopnum] is PictureBox)
             {
                 playerATKPanel.Controls[loopnum].Dispose();
             }
         }
     }
     if (makeGame.hasWon() != AI)
     {
         for (int loopnum = playerSHPPanel.Controls.Count - 1; loopnum >= 0; loopnum--)
         {
             if (playerSHPPanel.Controls[loopnum] is PictureBox)
             {
                 playerSHPPanel.Controls[loopnum].Dispose();
             }
         }
     }
 }