View Single Post
  #8  
Old June 4th, 2001, 03:25 AM
LazarusLong42's Avatar

LazarusLong42 LazarusLong42 is offline
Corporal
 
Join Date: Nov 2000
Location: Ann Arbor, MI, USA
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
LazarusLong42 is on a distinguished road
Default Re: Fix to movement problem

quote:
Originally posted by Cyrus:
The only reason why I've never wanted to write one is that you can't use a simple data structure, like a two dimensional array, to hold a game board.


Actually, a hex board would could easily be stored in a 2-d array. One axis of the board is your first array subscript; another axis 60 degrees away is the second subscript. Any member of a regular 2-d tesselation can be described by only two coordinates; the coordinate axes, however, won't necessarily be orthogonal to one another.

The only problem then becomes that along one diagonal [i,j] --> [i+1, j+1], the distance is 1, while along the other [i,j] --> [i+1, j-1], the distance between hexes is two.

LL <-- shoulda majored in math.

__________________
in Virtuo Design
Read my latest story at Speculon
Reply With Quote