Time for action – handling tiles
Add methods to the
TileMap
module that relate to reading and setting the tile index associated with individual map squares:#Region "Information about Map Tiles" Public Function GetTileAtSquare( tileX As Integer, tileY As Integer) As Integer If ((tileX >= 0) And (tileX < MapWidth) And (tileY >= 0) And (tileY < MapHeight)) Then Return _mapSquares(tileX, tileY) Else Return -1 End If End Function Public Sub SetTileAtSquare( tileX As Integer, tileY As Integer, tile As Integer) If ((tileX >= 0) And (tileX < MapWidth) And(tileY >= 0) And (tileY < MapHeight)) Then _mapSquares(tileX, tileY) = tile End If End Sub Public Function GetTileAtPixel( pixelX As Integer, pixelY As Integer) As Integer Return GetTileAtSquare( GetSquareByPixelX(pixelX), GetSquareByPixelY(pixelY)) End Function Public Function GetTileAtPixel(pixelLocation As Vector2...