Game Development Reference
In-Depth Information
'No one has moved.
Turn = 0
'Allocate the squares.
Fori=0To31
Squares(i) = New SquareData
Next
'Make this new board displayable.
Call ColorMe()
End Sub
#End Region
The system will complain that ColorMe does not exist, so we will do that next.
ColorMe is only called within the GameState class, so we will put it in a separate
region. Regions cannot overlap, so put the following code between the #End
Region and the End Class statements.
#Region "Internal Stuff"
Protected Sub ColorMe()
'The only given is where the fox and hounds are.
'Compute everything else.
'The square in game state.
Dim StateSquare As SquareData
'i is for going through squares.
Dim i As Integer
'ss is for subscripts of OTHER squares.
Dim ss As Integer
'The base state is an all black board.
'Do all squares (no need for the subscript).
For Each StateSquare In Squares
StateSquare.Holds = Checker.None
StateSquare.Kind = SquareColor.Black
StateSquare.Steps = UNREACHABLE
Next
'Add the fox.
Squares(Fox).Holds = Checker.Fox
Search Nedrilad ::




Custom Search