vb.net - Creating monopoly and Ludo in Visual Basic -
i want create monopoly board , ludo game in visual basic.net 2010.
how should represent board? thinking of picture boxes, clumsy handle individually. can create arrays of picture boxes?
also, since novice programmer, can tell features of visual basic useful game?
instead of adding controls in forms designer, can add them programmatically in vb (and c#). gives freedom of storing them wherever want in two-dimensional array. sure add them form.controls
property well.
dim board new picturebox(m-1, n-1) {} myform.suspendlayout() ' diminishes flicker. integer = 0 m - 1 k integer = 0 n - 1 dim pic = new picturebox() 'todo: set properties of picturebox here board(i, k) = pic myform.controls.add(pic) next k next myform.resumelayout()
also consider adding pictureboxes
tablelayoutpanel
instead of adding them directly form.
and, of cause, idea create board
class , handle board logic in class instead of performing logic in form event handlers. other classes player
or game
or score
can helpful well.
it better idea not create 2-d-array of pictureboxes array of square
class store additional information state of square or list of figures staying on square or reference special rule applies square , on. have great freedom in design of game. smart design easier handle , adapted other games working pictureboxes
in event handlers.
Comments
Post a Comment