title: Procedural Map Generation - SpriteKit and GameplayKit
body: <p>I have the following code to generate noise using the new <code>GameplayKit</code>'s <code>GKNoise</code>. I am not sure how I can use that with the <code>SKTileMapNode</code>. Has anyone tried this ? At the moment the noise is applied to each tile but not to the overall <code>TileMap</code>. Is there a way to use the generated noise to the whole map ?</p>
  
  <pre><code>let noise: GKNoise = GKNoise(noiseSource: GKPerlinNoiseSource())
  let noiseMap: GKNoiseMap = GKNoiseMap(noise: noise)
  let texture: SKTexture = SKTexture(noiseMap: noiseMap)
  
  let tileDef = SKTileDefinition(texture: texture)
  let tileGroup = SKTileGroup(tileDefinition: tileDef)
  let tileSet = SKTileSet(tileGroups: [tileGroup])
  
  // Create a tile map
  let tileSize = CGSize(width: 32.0, height: 32.0)
  let tileMap = SKTileMapNode(tileSet: tileSet, columns: 16, rows: 16, tileSize: tileSize)
  
  // Fill the entire map with a tile group
  tileMap.fill(with: tileGroup)
  
  self.addChild(tileMap)
  </code></pre>