0

Hi everyone I would like build a board based on some predefined tiles. The issue I am currently having is that some of the tile orientations on the board can be different from the actual tile image. As you can see from the image below for example tile B2 is rotated 180 degrees from its original orientation of tile B. I also need to be able to keep track of 1 to 6 points (indicated in the image in yellow) within each tile no matter the orientation of the tile. Is there a way to do this programmatically (dynamically) at run time? Any help would be appreciated.

Left of the arrow are tiles provided. The right of the arrow is an example of a small portion of the board. Some of its pieces, i.e. B2 are rotated from their original orientation. Also yellow dots indicate points within the tile that need to be kept track of no matter the orientation.

soccerman stan
  • 121
  • 1
  • 11
  • @Jarrod Roberson, I believe that soccerman stan is not asking how to visualize the board as in the question you linked him to. Rather, I believe he is asking how to use object oriented programming to physically hold the orientation of the tiles of the board. – NoseKnowsAll Feb 18 '15 at 16:17
  • Yes. You keep an array of ints corresponding to the orientation of the board piece. Th values could be 0, 60, 120, 180, 240, and 300, corresponding to the degree of rotation. – Gilbert Le Blanc Feb 18 '15 at 16:17
  • @NoseKnowsAll Yes you are correct, but I also need to keep track of multiple points on each tile of the board. This needs to hold true no matter how the tiles are rotated or how the board changes. – soccerman stan Feb 18 '15 at 16:31
  • My suggestion would be to have each `Tile` hold an array of 6 values (for instance `Tile A = new Tile(river, river, land, river, river, land);`). These values get stored in an internal array. And then you can always rotate the object simply by calling `A.rotate(rotation)` - a method to shift the values in the array by a specified amount. – NoseKnowsAll Feb 18 '15 at 16:35
  • @GilbertLeBlanc This code should be able to take in any number of tiles (not always the same set of tiles) so hard coding would not be an option. In my example case, A has four exits, and therefore we would need to keep track of the position of all four exits. – soccerman stan Feb 18 '15 at 16:37

0 Answers0