|
Public Class WorldBrush
Private intStartPosF As Integer
Private intEndPosF As Integer
REM: Filling the playground with impassable or passable areas:
Sub Fill(ptrPoint As Point, intFill As Integer)
Try
If OutOfField(ptrPoint) <> True Then
intStartPosF = ptrPoint.X + intStartNum(ptrPoint.Y)
intEndPosF = (ptrPoint.X + 39) + intStartNum(ptrPoint.Y)
For i = 0 To 40
For i2 = intStartPosF To intEndPosF
intWorldArr(i2) = intFill
Next
intStartPosF += szeWorldSize.Width
intEndPosF += szeWorldSize.Width
Next
End If
Catch ex As Exception
End Try
End Sub
Private Function OutOfField(ptrPoint As Point) As Boolean
Dim booReturn As Boolean = False
If ptrPoint.X < 5 Then Return True
If ptrPoint.Y < 5 Then Return True
If ptrPoint.X > (szeWorldSize.Width - 5) Then Return True
If ptrPoint.Y > (szeWorldSize.Height - 5) Then Return True
Return booReturn
End Function
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.