What's the simplest way to generate a random "path" for a level in a game? I don't know what search terms I should use to read more. I've looked into maze generation but thats not quite right.
The end result should look like this:

|
What's the simplest way to generate a random "path" for a level in a game? I don't know what search terms I should use to read more. I've looked into maze generation but thats not quite right. The end result should look like this:
|
|||||
|
|
As long as you don't want to go "back", meaning that your path goes only into a single direction (let's assume it is going downwards on your image), you can use the following C# code to easily generate those paths:
You can generate the path by calling it:
Here the first four parameters are start and end coordinates of your field (determining the dimensions) and the last parameter is the curving probability. Hope it helps... |
|||
|