prime31 / Nez

Nez is a free 2D focused framework that works with MonoGame and FNA
MIT License
1.76k stars 355 forks source link

Isometric Tile To World Position Fix #757

Closed Krashner closed 1 year ago

Krashner commented 1 year ago

The math for converting from the isometric tile space to world space was slightly off. I presume (Height - 1) was the original approach for centering the Vector2 on the tile, but it was causing the x coordinate to be off by 1. For worldY, I add an additional yOffset to center it, but it could be removed to set the point to the top left of the tile.

Here's a couple of images of the differences. The blue squares are walls, the orange ones are open tiles.

Before before

After after