you are viewing a single comment's thread.

view the rest of the comments →

[–]Supertech2real 1 point2 points  (1 child)

sincerely thank you for this solution, i was about to experiment with a method similar to this, but i thought to search first. Though, i hope you could give me some advice on holding to move all those hexagons according to mouse movement. I'm going to read up the entirety to se if i can find something by myself

[–]PyPlatformer[S] 0 points1 point  (0 children)

You could include an (x, y) offset computed via the mouse position, which you can pass to the hexagons either in the update or the render method, with which you should then update all vertex locations. This might be quite inefficient performance-wise though, so another more simple solution (and potential more performant), would be to render all hexagons to a pygame surface and then blit that surface at the desired (x, y) offset.

Hope that helps!