The Daily Click ::. Forums ::. Klik Coding Help ::. Hex Grid mapping
 

Post Reply  Post Oekaki 
 

Posted By Message

Wrim



Registered
  20/01/2009
Points
  552
12th August, 2013 at 12/08/2013 19:52:01 -

I'm trying to make a game where you build things out of hexagonal bits like this: Image
You can download it here to try it out: http://www.create-games.com/download.asp?id=8570

As of right now you can place blocks seamlessly wherever you want, but I want them to snap to each other in a hexagonal grid.

I found some clues to my solution here: http://community.clickteam.com/threads/74311-setting-up-a-fast-loop-hex-grid but I'm not sure how it'll help me.

If anyone has any advice please reply.

 
n/a

monkeytherat

Hero of Time Jr

Registered
  07/11/2010
Points
  1293

VIP MemberI donated an open source project
12th August, 2013 at 12/08/2013 21:45:05 -

The only thing that makes hex grid mapping different from square grid mapping is that every other column / row is staggered.


In pseudo-code, this would come out something like: http://pastebin.com/raw.php?i=ryvsbivT

You can do much the same thing with fastloops, or you can have an invisible layer of spaces and just make the hexagon at whichever invisible space you click on.

 
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
12th August, 2013 at 12/08/2013 22:10:20 -

http://www.create-games.com/download.asp?id=8855

 
n/a

Wrim



Registered
  20/01/2009
Points
  552
13th August, 2013 at 13/08/2013 11:14:27 -

Thank you so much for the help!

 
n/a

nivram



Registered
  20/07/2006
Points
  171
13th August, 2013 at 13/08/2013 16:33:36 -

Wrim. Your download link says "Page not found".

Marv

 
458 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm
   

Post Reply



 



Advertisement

Worth A Click