Re: [Freeciv-Dev] Suggestion: FreeCiv on a Hex!
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Artur Biesiadowski wrote:
> On Tue, 17 Aug 1999, Tony Stuckey wrote:
> > > coordinates are also not obvious - you will have either holes in array
> > > holding data or complicated proximity function.
> > What's not obvious about them? They're just a square map with the
> > odd columns offset half a square.
>
> But what tiles are adjacent to 10,10 ? 10,11 and 10,9 for sure. But on the
> right side ? 11,10 for sure and one of the 11,9 or 11,11. Which one
> depends on 'oddnes' of tile. I suppose that it is just (x+y)%2 == 0, but
> when you add such check everywhere it will stop to be readable.
> Of course it is not a major problem, just an annoyance.
Just define a few routines to determine whether two tiles are adjacant and
get a list of tiles adjacent to a cell. Similarly a couple of routines to
convert from screen coordinates to cell coordinates are almost all you need
to handle this. Probably some sort of mask for the terrain images too. I
don't think it would be very difficult to support squares, diamonds, and
hexes. Most of the work would be in the initial abstraction of the current
source (which I haven't looked at).
Regards,
Steve Hodge
|
|