Building the main form of the game
In our game, we have a visual grid of tiles. The most natural component to use in this context is the TGridLayout
component. Drop it on the main form of our app, change its Name property to GridLayoutTiles
, and align it with Client
so that it occupies the whole screen of the main form under the toolbar. Now, we can add other visual controls to the grid layout. The size of each item in the grid layout can be controlled with its ItemHeight
and ItemWidth
properties.
We are going to use the TGlyph
component to display bitmaps from our image list in the data module. There is also the TImage
component, which we could have used, but in this case, we would need to load bitmaps directly to every TImage
, which is not as effective as using just one set of bitmaps. Let’s get started:
- Change the background color of the main form to white. Expand
Fill
, then changeColor
toWhite
andKind
toSolid
. - Add the
uDMGameOfMem
unit to the uses clause...