public void render(Graphics2D g2d) {
        for (int row = rowOffset; row < rowOffset + numRowsToDraw; row++) {
            if (row >= rows) break;
            for (int col = colOffset; col < colOffset + numColsToDraw; col++) {
                if (col >= cols) break;
                if (map[row][col] == 0) continue;
                g2d.drawImage(getTile(row, col).getImage(), (int) x + col * tileSize, (int) y + row * tileSize, null);
            }
        }
    }