Log In  

Cart #40674 | 2017-05-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

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.

Cart #40471 | 2017-05-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

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.

P#40474 2017-05-11 17:04 ( Edited 2017-05-16 21:50)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-05-28 10:46:11 | 0.009s | Q:14