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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!