I'm using a simple rendering method in java to render tiles. Everything looks fine, but I notice that some rows grow 1 pixel when I move, and dhen shrink back, but I have no idea why. Infos: I'm using 16 x 16 tiles, my render method runs around 500 times per second, I use triple buffering, The code of my tile rendering method (located in the Screen class):
public void renderTile(int xPos, int yPos, Tile tile) {
xPos -= xOffset;
yPos -= yOffset;
for (int y = 0; y < 16; y++) {
int yPixel = y + yPos;
for (int x = 0; x < 16; x++) {
int xPixel = x + xPos;
if (yPixel < 0 || yPixel >= height) continue;
if (xPixel < 0 || xPixel >= width) continue;
pixels[(xPixel) + (yPixel) * width] = tile.sprite.pixels[x + y * tile.sprite.size];
}
}
}
I load sprites from sprite sheets, and they contain their pixel data in an array,
Can anyone help? (If any additional info is needed, tell me)