Tessellated hexagonal grid?

Richard Gaskin ambassador at fourthworld.com
Wed Jun 27 13:23:04 EDT 2018


David V Glasgow wrote:

 > I had already worked through the ‘redblobgames’ resources, and it was
 > the prospect of trying to implement a hex system in Livecode which was
 > the gotcha.
 >
 > The frustrating thing is that the polygon object displays a nice
 > scaleable hex - and yet it seems this is not a viable route?

I don't see why not.

There may be challenges if you have a very small tile size with many 
thousands of hexagons.  But you'd need quite a few before the object 
count would pose a difficulty.

Catan has only 19 tiles, and has captivated millions of minds for decades.

Even if you need several hundred, you'll likely find using LC's built-in 
hit-testing for those more efficient -- and certainly much easier to 
code -- than calculating boundaries arithmetically on the fly.

I started exploring hex grids myself a few months ago, in a rare evening 
of spare time.  Didn't come up with much worth sharing (I have no 
immediate need at the moment so I didn't spend much time with it), other 
than recognizing the value of a few key functions (finding bounding 
tiles, managing directional options, etc.) and gaining a healthy 
admiration for how much more straightforward this sort of work is made 
when using LC's native objects.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list