I guess I was writing in responce to the topic name sorry. I may have been clubbing lol.
I made league of legends (ok I got stumped on ai for champions) and the minions needed to go top mid and bot . To do this, on created at the nexus, i assigned them 1,2,or 3
If 1, i had a sprite in the top left to pathfind too, on reaching it, they would go towards enemy nexus (base)
On route they would stop when targeting. this isn't randomized in the slightest. Sorry.
I see what your saying sorry, getting carried away. .
If I wanted one path, I'd fill the map with blocks, and randomly place the base. Have the base spawn a larger sprite. And each block it overlaps needs a variable set to 1.
Next. Pick 1 block that =1 and spawn another large sprite over it. (This sprite may have to be a plus shape to avoid diagonal blocks. )
Set the next wave of blocks that are overlapping the checker to 2. Pick one block =2. Spawn checker.
This can be done In a loop, where the given value = the GV, and after its done, add 1 to the gv. You may want to consider setting all blocks next to the destroyed block as walls, using a booleon. And on checking blocks. Only pick one that has a false booleon. or only change the variable on a block if it =0
If you want real randomness, just continue until you reach the spawner . But it may be easier to have the player set a path distance. And when a block variable= path distance. Spawn the spawner, and destroy the final block and stop The loop . Multiple paths could be interesting..
Hope thats clear? No images to send sorry. It's the easiest was I could think, otherwise you could make random shapes and just destroy the blocks it overlaps.
There's a more dificult way to connect two objects, but programming is about finding easy ideas to solve hard problems.
You could also have a driller that enters the level first, and maybe give the player slight control over its random path making, prior to the game. just destroys randomly as a slow bullet that changes direction after it destroys block slightly, like rotate random (-30,30) +5' towards base. after a set time, find the path directly to the base, and destroy it, then start the waves.
Thank you for your helpful reply, I'll look into it more tomorrow.
The next issue would be making sure the path creates the right tile ex. if it's a corner or a straight way.
I tried working with a sprite walking around laying out a block depending on what block it was currently on, but that totally made construct bug out.
Have a nice evening ^^