public void renderTiles(Screen screen, int xOffset, int yOffset, boolean isForeground) {
        if (xOffset < 0)
            xOffset = 0;
        if (xOffset > ((width << 4) - screen.width))
            xOffset = ((width << 4) - screen.width);
        if (yOffset < 0)
            yOffset = 0;
        if (yOffset > ((height << 4) - screen.height))
            yOffset = ((height << 4) - screen.height);

        screen.setOffset(xOffset, yOffset);
        for (int y = (yOffset >> 4); y < (yOffset + screen.height >> 4) + 1; y++) {
            for (int x = (xOffset >> 4); x < (xOffset + screen.width >> 4) + 1; x++) {
            	if (isForeground)
            		getForeTile(x, y).render(screen, this, x << 4, y << 4);
            	else
            		getBackTile(x, y).render(screen, this, x << 4, y << 4);
            }
        }
    }