Created
July 28, 2022 08:46
-
-
Save KartikShrivastava/0738b115fd16673ab24e544a3c320491 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(hexMapUtil) { | |
if(hexMapUtil->staggerAxis == "x") { | |
tile->set_x(currX * (tileWidth - (hexMapUtil->hexSideLength/2))); | |
if((currX%2 == 0 && hexMapUtil->staggerIndex == "odd") || (currX%2 != 0 && hexMapUtil->staggerIndex == "even")) | |
tile->set_y(currY*tileHeight); | |
else | |
tile->set_y(currY*tileHeight + hexMapUtil->hexSideLength); | |
} | |
else { | |
tile->set_y(currY * (tileHeight - (hexMapUtil->hexSideLength/2))); | |
if((currX%2 == 0 && hexMapUtil->staggerIndex == "odd") || (currX%2 != 0 && hexMapUtil->staggerIndex == "even")) | |
tile->set_x(currX*tileWidth); | |
else | |
tile->set_x(currX*tileWidth + hexMapUtil->hexSideLength); | |
} | |
} | |
else { | |
tile->set_x(currX*tileWidth); | |
tile->set_y(currY*tileHeight); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment