Need help with logic for Octagon tile spawning

You need to be very clear about what you’re trying to do before you try and code it.

I understand what you’re talking about and the possibilities are not 64. It’s ‘ways of choosing x from y’:

How many ways to choose 0 from 8 ( written 8C0 ) = 1 +
How many ways to choose 1 from 8 ( written 8C1 ) = 8 +
8C2 = 28 +
8C3 = 56 +
… = 256

You could do it easily in concept with an array of 0 or 1. Just set the array with a loop and random int in range. Then shuffle it. Then just draw the tiles.

Or, you could make a blueprint tile which is randomly on or off. Then to make the next chunk of the corridor, just put 8 tiles there. It will always be different.

Then you can start thinking about difficulty settings. I already see a problem, I think, in that the walker will not be able to get from one corridor section to the next. But I could be misunderstanding your game mechanics…

Hope that helps…

1 Like