/**** 
* Classes
****/
// Sheep class
var Sheep = Container.expand(function () {
	var self = Container.call(this);
	self.avoidOtherSheep = function (sheepArray) {
		var separationDistance = 120;
		sheepArray.forEach(function (otherSheep) {
			if (otherSheep !== self && self.intersects(otherSheep)) {
				var dx = self.x - otherSheep.x;
				var dy = self.y - otherSheep.y;
				var distance = Math.sqrt(dx * dx + dy * dy);
				if (distance < separationDistance) {
					var angle = Math.atan2(dy, dx);
					self.direction += angle;
				}
			}
		});
	};
	var sheepGraphics = self.attachAsset('sheep', {
		anchorX: 0.5,
		anchorY: 0.5
	});
	self.speed = 1;
	self.direction = Math.random() * Math.PI * 2;
	self.move = function () {
		self.x += Math.cos(self.direction) * self.speed;
		self.y += Math.sin(self.direction) * self.speed;
	};
	self.avoidWalls = function () {
		if (self.x < 50 || self.x > 1998 || self.y < 50 || self.y > 2682) {
			self.direction += Math.PI;
		}
	};
	self.avoidDog = function (dog) {
		if (self.intersects(dog)) {
			self.direction += Math.PI / 2;
		}
	};
});
// Shepherd dog class
var Dog = Container.expand(function () {
	var self = Container.call(this);
	var dogGraphics = self.attachAsset('dog', {
		anchorX: 0.5,
		anchorY: 0.5
	});
	self.move = function (pos) {
		self.x = pos.x;
		self.y = pos.y;
	};
});
/**** 
* Initialize Game
****/
var game = new LK.Game({
	backgroundColor: 0x87CEEB // Light blue background to represent the sky
});
/**** 
* Game Code
****/
// Shepherd dog asset
// Sheep asset
// Initialize sheep array
var sheepArray = [];
// Create 20 sheep and add them to the game and sheepArray
for (var i = 0; i < 20; i++) {
	var sheep = new Sheep();
	sheep.x = Math.random() * 2048;
	sheep.y = Math.random() * 2732;
	game.addChild(sheep);
	sheepArray.push(sheep);
}
// Create shepherd dog and add it to the game
var shepherdDog = new Dog();
shepherdDog.x = 1024; // Start in the middle of the game area
shepherdDog.y = 1366;
game.addChild(shepherdDog);
// Event listener for touch move to move the shepherd dog
game.on('move', function (obj) {
	var pos = obj.event.getLocalPosition(game);
	shepherdDog.move(pos);
});
// Main game tick event
LK.on('tick', function () {
	// Move each sheep and avoid other sheep
	for (var i = 0; i < sheepArray.length; i++) {
		var sheep = sheepArray[i];
		sheep.move();
		sheep.avoidWalls();
		sheep.avoidDog(shepherdDog);
		sheep.avoidOtherSheep(sheepArray);
	}
});
// Ensure the game is touchscreen compatible
game.on('down', function (obj) {
	var pos = obj.event.getLocalPosition(game);
	shepherdDog.move(pos);
});
game.on('up', function (obj) {
	// This can be used for future features where the dog stops moving on touch up
}); ===================================================================
--- original.js
+++ change.js
@@ -1,90 +1,105 @@
-/****
+/**** 
 * Classes
 ****/
 // Sheep class
 var Sheep = Container.expand(function () {
-  var self = Container.call(this);
-  var sheepGraphics = self.attachAsset('sheep', {
-    anchorX: 0.5,
-    anchorY: 0.5
-  });
-  self.speed = 1;
-  self.direction = Math.random() * Math.PI * 2;
-  self.move = function () {
-    self.x += Math.cos(self.direction) * self.speed;
-    self.y += Math.sin(self.direction) * self.speed;
-  };
-  self.avoidWalls = function () {
-    if (self.x < 50 || self.x > 1998 || self.y < 50 || self.y > 2682) {
-      self.direction += Math.PI;
-    }
-  };
-  self.avoidDog = function (dog) {
-    if (self.intersects(dog)) {
-      self.direction += Math.PI / 2;
-    }
-  };
+	var self = Container.call(this);
+	self.avoidOtherSheep = function (sheepArray) {
+		var separationDistance = 120;
+		sheepArray.forEach(function (otherSheep) {
+			if (otherSheep !== self && self.intersects(otherSheep)) {
+				var dx = self.x - otherSheep.x;
+				var dy = self.y - otherSheep.y;
+				var distance = Math.sqrt(dx * dx + dy * dy);
+				if (distance < separationDistance) {
+					var angle = Math.atan2(dy, dx);
+					self.direction += angle;
+				}
+			}
+		});
+	};
+	var sheepGraphics = self.attachAsset('sheep', {
+		anchorX: 0.5,
+		anchorY: 0.5
+	});
+	self.speed = 1;
+	self.direction = Math.random() * Math.PI * 2;
+	self.move = function () {
+		self.x += Math.cos(self.direction) * self.speed;
+		self.y += Math.sin(self.direction) * self.speed;
+	};
+	self.avoidWalls = function () {
+		if (self.x < 50 || self.x > 1998 || self.y < 50 || self.y > 2682) {
+			self.direction += Math.PI;
+		}
+	};
+	self.avoidDog = function (dog) {
+		if (self.intersects(dog)) {
+			self.direction += Math.PI / 2;
+		}
+	};
 });
 // Shepherd dog class
 var Dog = Container.expand(function () {
-  var self = Container.call(this);
-  var dogGraphics = self.attachAsset('dog', {
-    anchorX: 0.5,
-    anchorY: 0.5
-  });
-  self.move = function (pos) {
-    self.x = pos.x;
-    self.y = pos.y;
-  };
+	var self = Container.call(this);
+	var dogGraphics = self.attachAsset('dog', {
+		anchorX: 0.5,
+		anchorY: 0.5
+	});
+	self.move = function (pos) {
+		self.x = pos.x;
+		self.y = pos.y;
+	};
 });
 
-/****
+/**** 
 * Initialize Game
 ****/
 var game = new LK.Game({
-  backgroundColor: 0x87CEEB // Light blue background to represent the sky
+	backgroundColor: 0x87CEEB // Light blue background to represent the sky
 });
 
-/****
+/**** 
 * Game Code
 ****/
-// Initialize sheep array
-// Sheep asset
 // Shepherd dog asset
+// Sheep asset
+// Initialize sheep array
 var sheepArray = [];
 // Create 20 sheep and add them to the game and sheepArray
 for (var i = 0; i < 20; i++) {
-  var sheep = new Sheep();
-  sheep.x = Math.random() * 2048;
-  sheep.y = Math.random() * 2732;
-  game.addChild(sheep);
-  sheepArray.push(sheep);
+	var sheep = new Sheep();
+	sheep.x = Math.random() * 2048;
+	sheep.y = Math.random() * 2732;
+	game.addChild(sheep);
+	sheepArray.push(sheep);
 }
 // Create shepherd dog and add it to the game
 var shepherdDog = new Dog();
 shepherdDog.x = 1024; // Start in the middle of the game area
 shepherdDog.y = 1366;
 game.addChild(shepherdDog);
 // Event listener for touch move to move the shepherd dog
 game.on('move', function (obj) {
-  var pos = obj.event.getLocalPosition(game);
-  shepherdDog.move(pos);
+	var pos = obj.event.getLocalPosition(game);
+	shepherdDog.move(pos);
 });
 // Main game tick event
 LK.on('tick', function () {
-  // Move each sheep
-  for (var i = 0; i < sheepArray.length; i++) {
-    var sheep = sheepArray[i];
-    sheep.move();
-    sheep.avoidWalls();
-    sheep.avoidDog(shepherdDog);
-  }
+	// Move each sheep and avoid other sheep
+	for (var i = 0; i < sheepArray.length; i++) {
+		var sheep = sheepArray[i];
+		sheep.move();
+		sheep.avoidWalls();
+		sheep.avoidDog(shepherdDog);
+		sheep.avoidOtherSheep(sheepArray);
+	}
 });
 // Ensure the game is touchscreen compatible
 game.on('down', function (obj) {
-  var pos = obj.event.getLocalPosition(game);
-  shepherdDog.move(pos);
+	var pos = obj.event.getLocalPosition(game);
+	shepherdDog.move(pos);
 });
 game.on('up', function (obj) {
-  // This can be used for future features where the dog stops moving on touch up
+	// This can be used for future features where the dog stops moving on touch up
 });
\ No newline at end of file
:quality(85)/https://cdn.frvr.ai/65c20e3bfc3df84f65ed5b94.png%3F3) 
 sheep, top view, cartoon style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
:quality(85)/https://cdn.frvr.ai/65c20e91fc3df84f65ed5ba1.png%3F3) 
 sheep, top view, cartoon style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
:quality(85)/https://cdn.frvr.ai/65c2146dfc3df84f65ed5c51.png%3F3) 
 Collie shepherd dog, top view, cartoon style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
:quality(85)/https://cdn.frvr.ai/65c41bbac10ed5ddaec9a589.png%3F3) 
 a white text bubble that says "baa," comic book style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
:quality(85)/https://cdn.frvr.ai/65c44fe407ae736c088fab87.png%3F3) 
 :quality(85)/https://cdn.frvr.ai/65c4660807ae736c088fabb1.png%3F3) 
 :quality(85)/https://cdn.frvr.ai/65c602b507ae736c088faf8b.png%3F3) 
 double-sided blue arrow in the form of a semicircle. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
:quality(85)/https://cdn.frvr.ai/65c6047507ae736c088fafd0.png%3F3) 
 computer mouse top view. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
:quality(85)/https://cdn.frvr.ai/65c81688a8ddea7da7af4b08.png%3F3) 
 :quality(85)/https://cdn.frvr.ai/65c85bd8a8ddea7da7af4bbc.png%3F3) 
 angry big bear, lying down and sleeping, top view, cartoon style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
:quality(85)/https://cdn.frvr.ai/65d727851c48391c143736c5.png%3F3) 
 erase