What happens is, I create and store something like a gridded Archimedean spiral with unique points when the game starts. Then, when a player builds on top of itself, the game runs through this spiral (in an outward fashion) and checks each space until it finds an empty one.
Forty third step complete (orange lines drawn in Paint for illustration):
Here is what the spiral algorithm would generate if I spaced it out 3 times (not using this one):
I'm in the middle of adding more features in regards to building and moving, so more progress updates on that coming soon!
No comments:
Post a Comment