1 decade ago by ChrisKochel
I'm writing the beginnings of a maze game using recursive division to fill the canvas with walls, each with one gap, then doing it again for the 2 new rooms, until none of the rooms can be divided anymore, and a maze is created.
So far, I am almost done making walls (without gaps yet, that will come later), but I seem to be recalculating the new area of each side after I draw a division incorrectly.
here is my live demo/work in progress complete with a link to the main.js and some comments being outputted to the console. Also here is where I got the idea to make the maze this way. It has code written in ruby which I do not know, but if you do, maybe it will show you something I missed.
Any help understanding my mistake is appreciated. ( I'll comment or update the OP if I figure it out.)
So far, I am almost done making walls (without gaps yet, that will come later), but I seem to be recalculating the new area of each side after I draw a division incorrectly.
here is my live demo/work in progress complete with a link to the main.js and some comments being outputted to the console. Also here is where I got the idea to make the maze this way. It has code written in ruby which I do not know, but if you do, maybe it will show you something I missed.
Any help understanding my mistake is appreciated. ( I'll comment or update the OP if I figure it out.)