This site requires JavaScript, please enable it in your browser!
Greenfoot back
decadence18
decadence18 wrote ...

2015/1/28

Hexagonal Grid?

decadence18 decadence18

2015/1/28

#
I would like to create a hexagonal grid for a game I'm trying to program. I have no idea how... But if at all possible, I want to avoid just taking someone's code and using it. I would like to actually understand the code so I can manipulate it as I need to... Can anyone help? The simpler the better...
danpost danpost

2015/1/28

#
It is no simple matter to create a hexagonal grid -- no matter how you try (I have done it, I should know). First, there is the not so simple relationship between the size of the hexagons and the differences in the offsets of adjacent grid locations horizontally and vertically. Then, there is the no so straight-forward translation of world coordinates to grid coordinates. Unless you are fairly well grounded in programming, I would suggest you build your skills up to something of this complexity. If you still want to attempt this, you may (instead of using) look at how I programmed my Hexagonal SuperWorld scenario. I believe I have it documented pretty well.
decadence18 decadence18

2015/1/29

#
Thank you for your help; I may try to convert the idea to a square grid system instead if movement is tile based instead of distance based however, as that may turn out more beneficial for this situation.
You need to login to post a reply.