Advertisement Jump to content
  • Advertisement

ThomasSchiefer

Member
  • Content Count

    0
  • Joined

  • Last visited

Community Reputation

100 Neutral

About ThomasSchiefer

  • Rank
    Newbie
  1. ThomasSchiefer

    Coordinates in Hexagon-Based Tile Maps

    First I want to thank you for this great tutorial. It really saved me. But I think that there is an error in the PseudoCode for SectionB. The error becomes apparent when you look at your if, else statement. They provide [b]four [/b]different possibilities. However when you look at your picture from a Section Type B you see that there are only [b]three [/b]different Hexagons. Therefore the correct code would look like: //pseudo Code!!! // right side if SectPxlX >= HexagonR then begin if sectPxlY < (2 * HexagonH - SectPxlX * m) then begin //upper area ArrayY := SectY - 1; ArrayX := SectX; end else begin ArrayY := SectY; ArrayX := SectX; end; end; // left side if SectPxlX < HexagonR then begin if SectPxlY < (SectPxlX * m) then begin //upper area ArrayY := SectY - 1; ArrayX := SectX; end else begin ArrayY := SectY; ArrayX := SectX - 1; end; end;PS: I already implemented a Java version and it is working fine.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!