Hacker News new | ask | show | jobs
by gereleth 1424 days ago
There aren't really any assets though. I just create the svgs dynamically. Maybe I need to place some strategic `Math.round` calls here and there, never thought of this =).
1 comments

Yeah so if you can math.round or math.floor them a bit the paths are a lot cleaner - if you're dynamically creating them anyway though then I don't know that it gains you much performance. It might gain some performance on render for larger maps? Not sure.

Didn't get a chance to look at your source.

The file to look at would be this Tile component: https://github.com/gereleth/hexapipes/blob/main/src/lib/puzz...

My svg handling was very much "learn as I go". An earlier version even had circles instead of hexagons because they're simpler to do. There's a cool playthrough video of that version: https://www.youtube.com/watch?v=vlpPr485NUY