Topic awaiting preservation: Can JS generate a hex map? |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: |
posted 06-08-2005 00:56
Ok, here's the deal. There is a play by email strategy game that I've been playing for a while, Atlantis if any of you have heard of it. I receive a text file every week that has an ascii display of the map and it shows me which units are in each hex, so on and so on. Well I have to write out a reply with the orders for each of my units and needless to say it can get quite confusing once you have a large force. Now I'm fairly confident that I can write a javascript to generate my orders for me in a way that I could just point and click on what I want to do and just have it write out my orders in a text box or something similar that I could cut and paste. |
Paranoid (IV) Inmate From: USA |
posted 06-08-2005 05:13
Of course it's possible. Really, a hex grid is a square grid with a trick to it: every other row is shifted half a column left or right. For example: code: XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
code: XXX XXX XXX XXX XXX OOO XXX XXX XXX XXX XXX XXX
code: renderx = (x * 32) + ((y & 1) * 16); rendery = (y * 32);
|
Nervous Wreck (II) Inmate From: |
posted 06-08-2005 17:55
Thanks for the help Iron Wallaby I'm not sure why I didn't think about that. My graphics for the hex tiles would of course be square but I guess if I used gifs with transparency than it wouldn't really matter. I would rather use pngs but if I remember right OE still has a problem doing transparency, is that correct? |
Paranoid (IV) Inmate From: USA |
posted 06-09-2005 05:00
Yes and no. MSIE has problems with 24-bit transparent PNG's, ie. PNG's with semi-transparent pixels (say, a 50% gray). It can handle binary transparency in 8-bit PNG's (the ones that are like GIF transparency). So, if you use transparency like a GIF, it works fine. |
Nervous Wreck (II) Inmate From: East Anglia, England. |
posted 06-10-2005 12:40
I did some work on this using PHP a while ago, before Firefox existed, and can confirm that PNG support is bad in IE. |
Nervous Wreck (II) Inmate From: |
posted 06-10-2005 17:26
Yeah I can see what you mean .. I hate IE. What is that that you were working on? Have you done anything more on it? |
Paranoid (IV) Inmate From: France |
posted 06-10-2005 18:33 |
Bipolar (III) Inmate From: East Anglia, England. |
posted 06-12-2005 17:37
I haven't done anymore work on it, it was for my son really, he wanted to try to recreate an online version of a battle card game. At the time, my ISP didn't support GIF's via GD in PHP so it would have to be non IE to look right. |