Skip to main content
2 of 2
replaced http://gamedev.stackexchange.com/ with https://gamedev.stackexchange.com/

After edits that makes things easier. Check out this topic: How do I generate a smooth random horizontal 2D tunnel?

  1. Initialize paths for SCREEN_WIDTH + BUFFER_WIDTH pixels.
  2. Every time you go further, add more curves, but don't remove old (as you can go back)
  3. I suggested curves, because pixels take more memory, though they might still be OK.