I didn´t know what I was doing at first, its quite crappy and everything, but after far too much time here you go: https://www.shadertoy.com/view/4sBGDh
I have no idea if this would actually be usable for your plans but from my experiments today, I´d say it might really be. But I have to admit that at least when procedurally generating the levels, its kinda strange to get started with those distance functions tongue