Skip to main content
GameDev.net gamedev.net
Using GameDev.net for your class this semester?
Learn more โ†’

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro โ€” $3/month.

Hexadecagon Maze Day 2

Hexadecagon Maze Day 2

puz
puz
Robot University -- a 2D DirectX Puzzle ยท ยท 1 min read
1,814 0

Day 2



Today I will establish a link between cells. To recap, although in Hexadecagon Maze the cell shapes are different, moving from left to right, at some point the pattern starts to repeat. Same holds for moving from bottom to top. The smallest collection of cells that repeat, I call it a "macro tile". In Hexadecagon Maze, the number happens to be 20 (figure (8)). This macro tile can be horizontally and vertically arrayed without gaps (figure (9)).
macro09.png
A cell is a triangle or a quadrilateral, so a cell has either 3 or 4 neighbors. The directions are assigned the numbers {0, 1, 2} or {0, 1, 2, 3}. For example, in figure (8), cell #12 has directions {0, 1, 2, 3}, which link to neighbors {16, 15, 8, 9} respectively. I call these movements "micro movements" because they stay within the macro tile. But some movements cross tile boundaries. For example, if we are currently inside of cell #19, then moving in the 0 direction puts us in cell #0 of the neighbor tile in the Northeast direction. Figure (9) defines the 9 possible directions we can travel between tiles. This I call "macro movements".
all_links_01.png

I hard-coded the micro and macro directions into the array that holds the coordinates of all line segments. To verify that I correctly entered them, I wrote a test program that displays all links as light blue lines (figure (10)).

Discussion

Loading comments...