0

I'm trying to build a game of battleships for my A level course but in all my projects so far have had to create two different arrays one that holds objects and one that hold different variables in a structure... I was wondering if there was any way to combine picture boxes and structures so they can hold more information than just a picture and location such as (in the case of battle ships) its coordinateds in MY grid(not on the screen) and wether its got a ship in it or not...

Thanks in advance

  • I'm not using VB, so I can't tell about the possibility of the PictureBox. If you want to keep your data together with the picture box information I suggest to create your own class with one data member being the picture box and others with your additional data belonging to that picture box. Then you have your data grouped together in your class and you can reference whatever is needed where you need it. – Csaba Benko Mar 26 '20 at 14:44
  • @CsabaBenko thanks I'll try that... I think I've found a solution though where I have two different arrays that are synced one that holds the data variables the other that holds the picture box. But Ill see if ur idea works as it does sound a lot better... – Luke Horner-Long Mar 27 '20 at 12:07

0 Answers0