python - How to to graphically select side lengths on a grid? -


i creating map builder game i've been designing, , have run issue users being able intuitively draw maps. map has hexagonal grid, , each grid location can have forest, town, etc. terrain. however, there rivers run along borders between hexes on grid. have implemented "cursor" show side being modified, shown in left image.

grid image

the method using identify cursor located shown in right image. if mouse present in hex, locates of 6 triangles inside , highlights respective side of hexagon.

it possible draw rivers using method, easy accidentally wander wrong triangle, resulting in patchy river when drawing straight lines.

the program written in pygame on python 3, although doesn't make of difference.

tl;dr: best way graphically select side length on grid (hexagonal or otherwise)?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -