Terrain generation the one used in Extreme platformer 2 basically extreme platformer 2 without the blob
very nice feel free to copy the code (dont forget to credit)