Hi there, I'm working on a little project in which i render a large tilemap. To save performance and don't having to draw 100x100 tiles each draw update, so instead i rendered the whole tilemap to a separate texture so i only have to draw one thing.
The problem I have is that I don't really know how to do collision detection with a large texture.
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
cave.draw(caveTiles[tileId]);
}
}
This code is for drawing all tiles to the texture.
Thanks in Advance.