Show HN: I made a puzzle game that gently introduces my favorite math mysteries
645 by MCSP | 125 comments on Hacker News.
This is the first iteration of a short game I’m making that tries to interactively explain some of my favorite math questions / ideas. My goal is mostly to get the player curious and not necessarily to explain absolutely everything. There were a lot of fun technical parts to building this: - For implementation reasons, it’s much easier if the lines all have integer intersection points with each other. To do this, when a new line is added I “cheat” by rounding intersections to integers and then splitting the old lines at the intersection into new linds (with potentially different slopes) going through the rounded point - I had to draw semi accurate maps of actual places (UK, South America, US west coast) in the HTML canvas using just line segments. I tried a few different solutions, including using SVG data. I ended up using the topojson library to give nice line approximations to GeoJSON maps - I use a simple backtracking algorithm to handle the live coloring of graphs - I use turf.js’s polygonize function to handle finding polygons from line segments (very happy I didn’t have to implement this myself!) - I wanted to make the game as mobile friendly as possible (don’t think I’ve nailed this quite yet) There were also a few tradeoffs I made: - I wanted give links earlier in the game for players to learn more, but I decided to wait until the end to maintain the flow of the game - In order to make the game more mobile-friendly, I generally stuck to maps with a small number of regions (at least for maps people have to interact with them). So for the most part all of the instances in the game are “easy”
New best story on Hacker News: Today, we hacked what we'd set out to hack: the iPhone
Today, we hacked what we'd set out to hack: the iPhone 649 by pavel_lishin | 427 comments on Hacker News.
-
рддेрдЬрд╕्рд╡िрдиी рдкрддрд╕ंрд╕्рдеेрдЪ्рдпा рдШोрдЯाрд│ेрдмाрдЬ рдкрджाрдзिрдХाрд░ी, рд╕ंрдЪाрд▓рдХांрд╡рд░ рдЧुрди्рд╣े рджाрдЦрд▓ рд▓ेрдЦाрдкрд░ीрдХ्рд╖рдХ рдмрдирд╕ोрдб рдпांрдЪ्рдпा рддрдХ्рд░ाрд░ीрдиंрддрд░ рдкोрд▓िрд╕ांрдЪी рдХाрд░рд╡ाрдИ рд╡рд░ोрд░ा ...
-
рд╡рд░ोрд░ा рднाрдЬрдкा рдкрд░िрд╡ाрд░ाрдд рдирд╡े рд╕рджрд╕्рдп – рд╡िрдХाрд╕ рдкрд░рдЪाрдХे рдпांрдЪा рднाрдЬрдкा рдк्рд░рд╡ेрд╢ рд╡рд░ोрд░ा : рд╡рд░ोрд░ा-рднрдж्рд░ाрд╡рддी рд╡िрдзाрдирд╕рднा рдХ्рд╖ेрдд्рд░ाрдЪे рдЖрдорджाрд░ рдХрд░рдг рджाрджा рджेрд╡...
-
рддेрдЬрд╕्рд╡िрдиी рдорд╣िрд▓ा рдкрддрд╕ंрд╕्рдеा рдШोрдЯाрд│ा рдк्рд░рдХрд░рдгाрдд рдЙрдЪ्рдЪ рди्рдпाрдпाрд▓рдпाрдЪे рдиिрд░्рджेрд╢ рд╕рд╣ा рдЖрдард╡рдб्рдпांрдд рд╡िрджिрдиिрд╖्рда рдЕрд╣рд╡ाрд▓ рд╕ाрджрд░ рдХрд░рдг्рдпाрдЪा рдЖрджेрд╢ рдЪंрдж्рд░рдкूрд░ : рд╡рд░...