I am trying my hand at android game development. I want to start with a simple 2D board game. What is the best way to draw a game board like the one in the image attacked below. The blue circles are points where the players can place objects.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
You should use a graph.
A graph is a set of connected nodes. In your case each node should have a position (vector), and an ID.
Outside the grapg you should store the connections. E.g. in your gfaph there are 5 nodes with the position (0;0), (0;1), (1;0), (1;1) and (0.5,0.5) and the IDs 0, 1 2, 3, and 4 respectively. Then your connection set would be
0-1, 0-3, 0-4, 1-4, 3-4, 2-1, 2-3, 2-5
Make sure they aren't duplicated.
You take every connection, get each IDs and their corresponding nodes, and using their positions, you draw a line.