I'm having some issues loading multiple tiles to my game. My game world currently has a pixel size of 770x450. I have loaded a single tile at position (0, 330), and wanted to make a loop that copies and loads the tile along the x axis until it reaches (770, 330).
I have been able to make this loop, however upon every loop, the next tile doesn't load, it just moves to the next position, here's the loop:
for (int i = 0; i < 770; i += 31)
{
position = new Vector2(i, 330);
// Some sort of draw method here!
if (i == 744)
{
i = i + 26;
// or here...
position = new Vector2(i, 330);
// or maybe here?
}
}
And if this helps, here's my current Draw()
method:
spriteBatch.Begin();
spriteBatch.Draw(gameTile, position, Color.White);
spriteBatch.End();