Binary Tree Algorithm and Gamify


I spent countless hours racking my brain over the overall game mechanics. A binary tree, where each node branches into two child nodes, seemed like a structure that could be well-suited for an endless runner concept. However, because it’s such an abstract and dynamic concept, it started to feel like some kind of multi-dimensional entity that I just couldn’t fully grasp in my head.

What helped was sketching it out—drawing on paper repeatedly to visualize the idea as clearly as possible. Once I grouped each node into classes and turned them into objects, implementing them through a centralized controller, it became much easier to generate ideas.

Interestingly, I found that a strictly balanced binary tree wasn’t as visually appealing. A more irregular, randomly generated binary tree looked much more dynamic. So, I designed the system so that at each interval, a node would split, but only one of its child nodes—either the left or the right—would continue splitting. From that point on, things started to flow more smoothly. Whenever a node split, enemies would reference their parent node to determine their position, based on the position of the terminal nodes.

Files

NodeCut02.zip Play in browser
60 days ago

Leave a comment

Log in with itch.io to leave a comment.