sprite = images[5];
// Do not draw over the left side, but let the scroll overflow from the
// right if there's no space
int rightX = Math.max(width - TILE_SIZE, TILE_SIZE);
for (int y = TILE_SIZE; y < height - TILE_SIZE; y += TILE_SIZE) {
sprite.draw(g, rightX, y);
}
// bottom
sprite = images[7];
// Do not draw over the top border, but let the scroll overflow from the
// bottom if there's no space