I'm in a bit of crunch time and I find myself spending way too much time tinkering with an algo, so I would like some help.
In the game I am working on, there are some old-style, pixelated minigames. One of the minigame is a spaceship in a cavern. The caverns curves and narrows down over time until the ship crashes in a wall. I want them to be generated at random during runtime.
I'm having a problem creating the walls of the cavern and narrowing them while keeping a smooth curve on them.
For the narrowing, I keep track of it with a variable that decreases over time, but how about the curving and how to keep it natural? I've though of a keeping a target point that goes up and down randomly and have the wall try to reach for it, therefore smoothing the randomized number but it is not working great.
Any ideas/algo?