Posted By
Message
Fifth QuadrupedRegistered 07/05/2003
Points 5818
1st March, 2012 at 01/03/2012 16:54:47 -
Right, I'll see what I can do. Hexagons should be an interesting problem to tackle.
Go Moon!
Fifth QuadrupedRegistered 07/05/2003
Points 5818
1st March, 2012 at 01/03/2012 19:29:27 -
Alright, got it. Dealing with hexagons is trickier business than I had thought. I wish you good luck in making a complete game around them.
http://www.l-ames.com/logan/arraytest3.mfa
Go Moon!
SolarB
Registered 26/12/2011
Points 564
2nd March, 2012 at 02/03/2012 03:46:03 -
Thanks so much fifth, this is utterly awesome. That kind of math is much to complex for me to get my head around
Cheers!
My Open Source Examples: http://bit.ly/YyUFUh
Fifth QuadrupedRegistered 07/05/2003
Points 5818
4th March, 2012 at 04/03/2012 22:21:10 -
Yarr, no problem!
...Though really, when I was trying to figure it out, I realized you could probably get by with a much simpler interpretation of the hex grid.
You see, the first part of making the hex grid work was simply taking a normal grid, squashing it, and offsetting every other row.
And frankly, that last grid would be good enough for most uses. Especially if you're controlling your movement by setting hex-based paths beforehand.
It was the last part of turning it into a hex grid that was tricky, which was just the extra little zig-zag at the bottom/top of each tile space.
And you'd never really need to detect the object moving over those little zig-zags, really.
...Anyway, the example does include the zig-zags to make proper hex tiles, it just seems it's not ever really worth the extra math.
I dunno, just something to think about.
Go Moon!
Sketchy Cornwall UKRegistered 06/11/2004
Points 1971
4th March, 2012 at 04/03/2012 22:53:15 -
Ah, the classic square-hexagons
I'd be tempted to use some transition tiles to make nice soft edges, but I can't be bothered.
n/a
Fifth QuadrupedRegistered 07/05/2003
Points 5818
4th March, 2012 at 04/03/2012 23:53:33 -
Heh, I didn't realize that was ever a thing.
But you could still make the tiles look like hexagons while using the simpler positioning math of the hexagon-squares.
Go Moon!
nivram
Registered 20/07/2006
Points 171
5th March, 2012 at 05/03/2012 00:19:06 -
Hi Sketchy. Why can you not be bothered?
Thanks,
Marv
458 MMF2 & CTF 2.5 examples and games
http://www.castles-of-britain.com/mmf2examples.htm
SolarB
Registered 26/12/2011
Points 564
8th March, 2012 at 08/03/2012 06:15:07 -
@Fifth:
Thanks again, and that's some good theory. But which part exactly is the extra zig-zag math in your example? Not a huge matter, but would still like to know.
Cheers
My Open Source Examples: http://bit.ly/YyUFUh