Skip to content

Instantly share code, notes, and snippets.

@KartikShrivastava
Created August 2, 2022 17:31
Show Gist options
  • Save KartikShrivastava/a5ff3dfa8ba4f56236cae6a8cec73f21 to your computer and use it in GitHub Desktop.
Save KartikShrivastava/a5ff3dfa8ba4f56236cae6a8cec73f21 to your computer and use it in GitHub Desktop.
else if(roomOrientation == RoomOrientation::staggered) {
if(!staggeredIsoMapUtil) {
errStream << "Error loading tiles for staggered iso map, staggered map details incomplete." << std::endl;
return false;
}
if(staggeredIsoMapUtil->staggerAxis == "x") {
tile->set_x(currX * mapTileWidth / 2);
if((currX%2 == 0 && staggeredIsoMapUtil->staggerIndex == "odd") ||
(currX%2 != 0 && staggeredIsoMapUtil->staggerIndex == "even"))
tile->set_y(currY * mapTileHeight);
else
tile->set_y((currY * mapTileHeight) + mapTileHeight / 2);
}
else {
tile->set_y(currY * mapTileHeight / 2);
if((currY%2 == 0 && staggeredIsoMapUtil->staggerIndex == "odd") ||
(currY%2 != 0 && staggeredIsoMapUtil->staggerIndex == "even"))
tile->set_x(currX * mapTileWidth);
else
tile->set_x((currX * mapTileWidth) + mapTileWidth / 2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment