edLevel) {
          level = parseInt(savedLevel);
        }
      }
      // Save game progress
      function saveProgress() {
        localStorage.setItem("shepherdsDogLevel", level);
      }

      // Initialize sheep and obstacles
      function initLevel(levelConfig) {
        // Clear existing sheep, obstacles, and wolves.
        sheep.forEach((s) => s.remove());
        obstacles.forEach((o) => o.remove());
        wolves.forEach((w) => w.remove());
        sheep = [];
        obstacles = [];
     