I want to create a monopoly board and the ludo game in Visual Basic.NET 2010.
How should I represent the board? I was thinking of picture boxes, but then they get too clumsy to handle individually. Can you create arrays of picture boxes?
Also, since I am just a novice programmer, can you tell what features of Visual Basic will be useful for this game?
Instead of adding controls in the Forms designer, you can always add them programmatically in VB (and C#). This gives you the freedom of storing them wherever you want as in a two-dimensional array. Be sure to add them to the
Form.Controlsproperty as well.Also consider adding the
PictureBoxesto aTableLayoutPanelinstead of adding them directly to the form.And, of cause, it is a good idea to create a
Boardclass and to handle all the board logic in that class instead of performing the logic in the form event handlers. Other classes likePlayerorGameorScorecan be helpful as well.It would be even a better idea not to create a 2-D-array of PictureBoxes but an array of some
Squareclass that could store additional information like the state of a square or a list of figures staying on the square or a reference to a special rule that applies to a square and so on. You have a great freedom in the design of a game. A smart design separating game logic from UI details is much easier to handle and can evolve more easily.