Game Development Reference
In-Depth Information
'Make a graphical board reflect this game state.
Public Sub MarkButtons(ByVal Board() As Button)
Dim i As Integer
'The square on the board.
Dim BoardSquare As Button
'The same square in game state.
Dim StateSquare As SquareData
BoardSquare = Board(i)
StateSquare = Squares(i)
'Set the back color of that square.
Select Case StateSquare.Kind
Case SquareColor.Black
BoardSquare.BackColor = Color.Black
Case SquareColor.Green
BoardSquare.BackColor = Color.Green
Case SquareColor.White
BoardSquare.BackColor = Color.White
End Select
'Set the text of that square and maybe
'improve the back color.
Select Case StateSquare.Holds
Case Checker.Fox
BoardSquare.Text = "Fox"
'Fox needs better colors.
Select Case StateSquare.Kind
Case SquareColor.White
BoardSquare.BackColor = Color.LightPink
Case SquareColor.Black
BoardSquare.BackColor = Color.Red
Case SquareColor.Green
BoardSquare.BackColor = Color.LightGreen
End Select
Case Checker.Hound
BoardSquare.Text = "Hnd"
'Can't read text on black.
BoardSquare.BackColor = Color.DarkGray
Case Checker.None
Search Nedrilad ::

Custom Search