So i'm doing a board game and the only idea that came to mind was to make the board with picture boxes. My board is 26 per 32 squares which means that i need alot of picture boxes to do this.
I thought of two methods and i'm not sure if they work.
One would be to actually put the 832 pictures boxes on my form and then run through them and populate the array however this would make the form really messy and laggy to make. I wrote a bit of code by hand on this, don't know if it would work but it's just to have an idea:
For i = 831 To 0 Step -1
PictureBox.i
For e = arrMap(0, 0) To arrMap(25, 31)
arrMap(a, e) = PictureBox.i
If e = 32 Then
e = 0
a = a + 1
End If
Next
Next
The other method that i thought of was to put one picture box in the right place and then create another next to it and put it into the array on the next index location, when the a row is completed i would then put another one on top of the starting point and continue like that until all the picture boxes are create and in the Array.
I think i need the array because i need to compare position on the game pieces and the array i think it's the best way to do so.
Is there a better way to make the board for the game or if this is viable any ideas?
PS. I'm doing this is VB
TableLayoutPanel
and add aPictureBox
to each cell. Not sure if there would be performance issues but that's the first thing I would try.