rrentSheep.vx * currentSheep.vx + currentSheep.vy * currentSheep.vy);
        if (speed > maxSpeed) {
          currentSheep.vx = (currentSheep.vx / speed) * maxSpeed;
          currentSheep.vy = (currentSheep.vy / speed) * maxSpeed;
        }

        // Update position
        currentSheep.x += currentSheep.vx;
        currentSheep.y += currentSheep.vy;

        // Keep sheep within bounds
        currentSheep.x = Math.max(5, Math.min(currentSheep.x, gameContainer.offsetWidth - 15));
        currentSheep.