Tuesday, August 24, 2021

I talked about doing an oval world poly grid but what I actually did was revisit the dead simple to do list from a couple of weeks ago, because it helps me understand dynamically created clickable elements better, and I also removed the double-click functionality from my page because that’s wasted on my cell! I hacked a perfectly good work-around, though.

I have a number of experiments which I need to do so that I can use my clickable elements to create and interact with a world map. I can get the mouse position but it is a bit unreliable for this stuff. What I can do is derive a position when I click on an element and then use that to do some math, find the mouse position relative to my element and then move the element around based on that. Thinking about this, I need to splat out a doppelganger of some element I created with the page when I click the mouse, or maybe my mouse is offscreen by default? Hmmm…

I could do a tile-laying game, with triangles or more complex polygons. I can splat out a triangle and push out three ‘petals’ off of the three edges of that triangle. This original triangle is green and we can toggle it between blue and green for sea and land. The petals are tan or grey and when we select them we trigger the page to generate more triangles off of the two open edges and toggle it between green and blue. I can calculate the area of these triangles as I go along.


No comments:

Post a Comment