Game Development Reference
In-Depth Information
Figure 4.4
Some vital numbers on the user interface.
and the number of mines. Removing a flag increases both. Add the following
code to PlayingField.vb to handle those changes:
'Code to change the counters - convert the text to int,
'add or subtract one, change back to text. 2 for moves,
'and 2 for mines
Public Sub DecrementMovesLeft()
MovesLeftLabel.Text = (CInt(MovesLeftLabel.Text) - 1).ToString
End Sub
'If you undo a flag, the resulting blank is a valid move
Public Sub IncrementMovesLeft()
MovesLeftLabel.Text = (CInt(MovesLeftLabel.Text) + 1).ToString
End Sub
'Usually by placing a flag
Public Sub DecrementMinesLeft()
MinesLeftLabel.Text = (CInt(MinesLeftLabel.Text) - 1).ToString
End Sub
Search Nedrilad ::

Custom Search