Jump to content

April 2017 »

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526 27 2829
30      

Recent Entries

Recent Comments

Recent Entries

Recent Comments

- - - - -

Hexadecagon Maze Day 2


Hexadecagon Maze Visual Studio C++ MFC
4: Adsense

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)).
Posted Image
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".
Posted Image

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)).

Note: GameDev.net moderates comments.