tSheep = sheep;
            }
          }

          if (closestSheep) {
            const dx = closestSheep.x - wolf.x;
            const dy = closestSheep.y - wolf.y;
            const angle = Math.atan2(dy, dx);
            wolf.vx = Math.cos(angle) * 1; // Wolf speed
            wolf.vy = Math.sin(angle) * 1;

            wolf.x += wolf.vx;
            wolf.y += wolf.vy;

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