Hi there, I need some help with scrolling a tile map.
This is the code I got at the moment for drawing the tile map
for (int x = 0; x < worldMap.size(); x++) {
for (int y = 0; y < worldMap[x].size(); y++) {
int tileId = worldMap[y][x];
// Get the width and height of the image
int width = 64;
int height = 64;
// Adjust the offset by using the width and height of the image used
caveTiles[tileId].setPosition(x * width, y * height);
// Draw the tiles
window.draw(caveTiles[tileId]);
}
}
I have tried looking for others that might have done it but i can't find a good tutorial about it in sfml 2.0.
No now I'm turning to you.
Thanks in advance