From: <wak...@ea...> - 2005-05-09 22:07:55
|
I've been doing a lot of thinking about how to approach drawing the map board. I've also been crawling around the Colossus source code to get some ideas on how they tackled the problems that are very similar to our own. Here's how they've done it, I think a similar approach may work for us as well: 1. They defined an XML DTD that defines the shape of the board in simple alpha-numeric coordinates: label ( A1|A2|A3| B1|B2|B3|B4| C1|C2|C3|C4|C5| D1|D2|D3|D4|D5|D6| E1|E2|E3|E4|E5| F1|F2|F3|F4 ) #REQUIRED The DTD also defines the types of terrains available to be potentially assigned to each hex. 2. An XML file, using the DTD, assigns the default terrain for the map and then specifies which hexes deviate from this default: <battlemap terrain="Brush" tower="False"> <battlehex x="0" y="2" terrain="Brambles" elevation="0"> </battlehex> <battlehex x="1" y="3" terrain="Brambles" elevation="0"> </battlehex> </battlemap> 3. The Hex object, along with child objects, serves to track each indivdual hex's properties, including entrances and exits. I think that for the purposes of developing a route validator/calculator, we'll need to be able to track this information for each tile layed. For defining tiles, I think we'll need a Tile class that extends from Hex, and stores information related to the layout of the track. Any comments on these initial points? ---Brett |