Isometric algorithm [fixed]
- by David
so i've been toying with isometric and i just cant get the tiles to be in the right order.
im probably missing something obvious and i just cant see it...
but even at the risk of looking stupid, heres my code.
for (int i = 0; i < Tile.MapSize; i++)
{
for (int j = 0; j < Tile.MapSize; j++)
{
spriteBatch.Draw(
Tile.TileSetTexture, new Rectangle(
(-j * Tile.TileWidth / 2) + (i * Tile.TileWidth / 2),
(i * (Tile.TileHeight - 9) / 2) - (-j * (Tile.TileHeight - 9) / 2),
Tile.TileWidth, Tile.TileHeight),
Tile.GetSourceRectangle(tileID),
Color.White,
0.0f,
new Vector2(-350, -60),
SpriteEffects.None,
1.0f);
}
}
and heres what i end up with
delicious messed up map
yep, bit of an issue. so if anyone could help, i'd appreciate it.
edit*
works now <_<