title: Generating random terrain in SpriteKit
body: <p>First of all I want to mention that I have no deep knowledge about games or SpriteKit framework (however, I have good programming skills).</p>
  
  <p>I want to create a 2D game for iPhone and iPads. So far, I know that I have to use SpriteKit. However, the most import of this game is the terrain. I should be able to generate it dynamically so it will have curves (but not spike edges) like the black line from the attached image. Also, I would like to have the down part of ground in two separate layers (one thin layer of green to simulate grass and the rest some brownish color to simulate dirt), but this is something nice to have.</p>
  
  <p>Also I would like to know how can I "explode" a little portion of ground when something (like an cannon ball) touches it.</p>
  
  <p>Can someone explain or guide me on how can I achieve this?</p>
  
  <p><a href="https://i.stack.imgur.com/n7zx6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n7zx6.png" alt="example of random generated ground"></a></p>
  
  <p>Thank you!</p>