Help with boardgame movement

4.2.2

So I want to make a web of points and lines where the player character can only click on adjacent points to move to them if there is a line between them. However, all tutorials I could find on YT only describe how to make side-scrolling platformer games or tile-based board games. I’m hoping for some suggestion on where to start.

For reference, I’m looking to create a play area like this, but obviously I’m happy with being able to create a 3 point 3 line triangle version for now.

I’d represent the dots by a graph, vertices are your cities (maybe create a class that can hold its name and location) and edges are the lines between cities

Use an adjacency matrix to represent the graph in your code then you could place your dots in your scene by iterating your vertices (cities). Checking if cities are connected is very efficient with adjacency matrixes

1 Like