Drawing is now optimised in two ways:
1) Center of hexagone are pre-computed once, drawing use that.
2) No wall is ever redraw a second time
Comments and suggestions are welcome.
This is a random maze generator, but the maze have hexagone "cell".
There is no game, no goal, it is just a demo.
To make it a bit more interesting, I provide an interface to modify the size and "shape" of the grid. By shape I mean non perfect hexagone that are taller in one or two directions.
Everything is draw with line and no sprite are used.
There is a lot of math to find the best scale and compute what lines to draw.
It is also unperfect because of the rounding, maybe I should work out to only work with integer to avoid the rounding side effect.
Once optimised I will need to see if it would be workable to draw the map in 30 fps to use that in game.
Please test and give me your comment.
Or better, also check the code and give me your comment.
[Please log in to post a comment]