Time for action – handling tiles
Add methods to the TileMap class that relate to reading and setting the tile index associated with individual map squares:
#region Information about Map Tiles static public int GetTileAtSquare(int tileX, int tileY) { if ((tileX >= 0) && (tileX < MapWidth) && (tileY >= 0) && (tileY < MapHeight)) { return mapSquares[tileX, tileY]; } else { return -1; } } static public void SetTileAtSquare(int tileX, int tileY, int tile) { if ((tileX >= 0) && (tileX < MapWidth) && (tileY >= 0) && (tileY < MapHeight)) { mapSquares[tileX, tileY] = tile; } } static public int GetTileAtPixel(int pixelX, int pixelY) { return GetTileAtSquare( GetSquareByPixelX(pixelX), GetSquareByPixelY(pixelY)); } static public int GetTileAtPixel(Vector2 pixelLocation) { return GetTileAtPixel( (int)pixelLocation.X,...