User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'expand')' in this line: 'var DistractingFish = Fish.expand(function () {' Line Number: 23
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'expand')' in this line: 'var InflatableFish = Fish.expand(function () {' Line Number: 1
User prompt
Improve the entire code with 10 new functionality
User prompt
Improve the entire code with 4 new functionality
User prompt
Improve the entire code with 4 new functionality
User prompt
Make fish move
User prompt
Fix Bug: 'Uncaught TypeError: aquarium.getWaterBounds is not a function' in this line: 'var waterBounds = aquarium.getWaterBounds();' Line Number: 1630
User prompt
Improve the entire code with 6new functionality
User prompt
Fix Bug: 'Uncaught ReferenceError: Food is not defined' in this line: 'var SpeedyFood = Food.expand(function () {' Line Number: 535
User prompt
Fix Bug: 'Uncaught ReferenceError: DecorativePlant is not defined' in this line: 'var GrowingPlant = DecorativePlant.expand(function () {' Line Number: 444
User prompt
Fix Bug: 'Uncaught ReferenceError: Bubble is not defined' in this line: 'var CapturingBubble = Bubble.expand(function () {' Line Number: 83
User prompt
Improve the entire code with 4 new functionality
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'expand')' in this line: 'var BubbleProducingFish = Fish.expand(function () {' Line Number: 107
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'expand')' in this line: 'var FoodSpawningFish = Fish.expand(function () {' Line Number: 67
User prompt
Improve the entire code with 6 new functionality
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'expand')' in this line: 'var IntelligentFish = Fish.expand(function () {' Line Number: 31
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'expand')' in this line: 'var TreasureChest = InteractiveElement.expand(function () {' Line Number: 1
User prompt
Improve the entire code with 4 new functionality
User prompt
Improve the entire code with 8 new functionality
User prompt
Improve the entire code with 4 new functionality
User prompt
Improve the entire code with 4 new functionality
User prompt
Make fish move 3 time slower
User prompt
Improve the entire code with 4 new functionality
User prompt
Improve the entire code with two new functionality
User prompt
Improve the entire code with two new functionality
===================================================================
--- original.js
+++ change.js
@@ -63,16 +63,15 @@
}
};
return self;
});
-var FishFeeder = Container.expand(function () {
- var self = Container.call(this);
- var feederGraphics = self.createAsset('fishFeeder', 'Fish Feeder Graphics', 0.5, 0.5);
+var FoodSpawningFish = Fish.expand(function () {
+ var self = Fish.call(this) || this;
self.foodReleaseRate = 5;
self.releaseFood = function () {
var food = new Food();
food.x = self.x;
- food.y = self.y - feederGraphics.height;
+ food.y = self.y;
LK.stageContainer.addChild(food);
var nearbyFish = self.getNearbyFishWithinRange(500);
nearbyFish.forEach(function (fish) {
fish.rushToFood(food);
@@ -104,23 +103,26 @@
}
};
return self;
});
-var BubbleFeeder = Container.expand(function () {
- var self = Container.call(this);
- var feederGraphics = self.createAsset('bubbleFeeder', 'Bubble Feeder Graphics', 0.5, 0.5);
+var BubbleProducingFish = Fish.expand(function () {
+ var self = Fish.call(this) || this;
self.bubbleReleaseRate = 5;
self.releaseBubbles = function () {
var bubble = new Bubble();
bubble.x = self.x;
- bubble.y = self.y - feederGraphics.height;
+ bubble.y = self.y;
LK.stageContainer.addChild(bubble);
var nearbyFish = self.getNearbyFishWithinRange(500);
nearbyFish.forEach(function (fish) {
- fish.increaseHappiness();
+ if (!fish.isCaptured) {
+ fish.isCaptured = true;
+ fish.y -= 10;
+ }
});
};
LK.setInterval(self.releaseBubbles, 10000);
+ return self;
});
var AquariumDecorator = Container.expand(function () {
var self = Container.call(this);
self.decorate = function () {};
@@ -430,14 +432,14 @@
var InteractiveDecoration = InteractiveElement.expand(function () {
var self = InteractiveElement.call(this) || this;
self.interactWithFish = function (fish) {};
});
-var AquariumPlant = Container.expand(function () {
+var DecorativePlant = Container.expand(function () {
var self = Container.call(this);
self.growthRate = 0.02;
self.nutritionValue = 10;
self.healthValue = 5;
- var plantGraphics = self.createAsset('aquariumPlant', 'Aquarium Plant Graphics', 0.5, 1);
+ var plantGraphics = self.createAsset('decorativePlant', 'Decorative Plant Graphics', 0.5, 1);
self.on('tick', function () {
plantGraphics.scale.x += self.growthRate;
plantGraphics.scale.y += self.growthRate;
if (plantGraphics.scale.x > 4) {
@@ -451,21 +453,24 @@
fish.health = Math.min(fish.health + self.healthValue, 100);
self.destroy();
}
};
+ return self;
});
-var HealingPlant = Container.expand(function () {
- var self = Container.call(this);
- var plantGraphics = self.createAsset('healingPlant', 'Healing Plant Graphics', 0.5, 1);
+var HealingFish = Fish.expand(function () {
+ var self = Fish.call(this) || this;
self.healingRate = 0.1;
self.healingRange = 100;
- self.on('tick', function () {
+ self.healNearbyFish = function () {
var nearbyFish = self.getNearbyFishWithinRange(self.healingRange);
nearbyFish.forEach(function (fish) {
if (fish.health < 100) {
fish.health = Math.min(fish.health + self.healingRate, 100);
}
});
+ };
+ self.on('tick', function () {
+ self.healNearbyFish();
});
return self;
});
var Coin = Container.expand(function () {
@@ -1568,14 +1573,14 @@
fish.y += fish.height / 2;
}
};
});
-var HidingFish = Fish.expand(function () {
+var CamouflageFish = Fish.expand(function () {
var self = Fish.call(this) || this;
self.hide = function () {
var predators = self.getNearbyPredators();
if (predators.length > 0) {
- self.alpha = 0.5;
+ self.alpha = 0.3;
} else {
self.alpha = 1.0;
}
};
@@ -1586,8 +1591,9 @@
};
self.on('tick', function () {
self.hide();
});
+ return self;
});
var FishSpawner = Container.expand(function () {
var self = Container.call(this);
var fishTypes = [Fish, KoiFish, Goldfish, GuppyFish, BettaFish, Angelfish, Clownfish, Pufferfish, Surgeonfish];
@@ -1616,42 +1622,23 @@
}
return fishes;
};
});
-var SmartFish = Fish.expand(function () {
+var MentorFish = Fish.expand(function () {
var self = Fish.call(this) || this;
- self.intelligenceLevel = 10;
- self.avoidPredators = function () {
- var predators = self.getNearbyFish().filter(function (otherFish) {
- return otherFish.size > self.size && self.distanceTo(otherFish) < 300;
+ self.intelligenceBoostRate = 1;
+ self.boostRange = 200;
+ self.boostIntelligence = function () {
+ var nearbyFish = self.getNearbyFishWithinRange(self.boostRange);
+ nearbyFish.forEach(function (fish) {
+ if (!(fish instanceof MentorFish)) {
+ fish.intelligenceLevel = Math.min(fish.intelligenceLevel + self.intelligenceBoostRate, 100);
+ }
});
- if (predators.length > 0) {
- var escapeVector = {
- x: 0,
- y: 0
- };
- predators.forEach(function (predator) {
- var angle = Math.atan2(self.y - predator.y, self.x - predator.x);
- escapeVector.x += Math.cos(angle);
- escapeVector.y += Math.sin(angle);
- });
- self.targetRotation = Math.atan2(escapeVector.y, escapeVector.x);
- }
};
- self.seekFood = function () {
- var foodSources = self.getNearbyObjects().filter(function (obj) {
- return obj instanceof Food;
- });
- if (foodSources.length > 0) {
- var closestFood = foodSources[0];
- for (var i = 1; i < foodSources.length; i++) {
- if (self.distanceTo(foodSources[i]) < self.distanceTo(closestFood)) {
- closestFood = foodSources[i];
- }
- }
- self.targetRotation = Math.atan2(closestFood.y - self.y, closestFood.x - self.x);
- }
- };
+ self.on('tick', function () {
+ self.boostIntelligence();
+ });
return self;
});
Fish.prototype.increaseSpeed = function (speedMultiplier, duration) {
var originalSpeed = this.speed;
An aquarium with no fish on a sheel in a photorealistic style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic goldfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic Angelfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic koyfish swiming to the right. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic gupyfish swiming to the right. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic bettafish swiming to the right. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic clownfish swiming to the right. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic pufferfish swiming to the right. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic surgeonfish swiming to the right. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic buble of water. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic fish egg. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic celestial pearl danio. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic Parrotfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic dartfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic moorishidol. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic tangfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic bannerfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic butterflyfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic mandarinfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a realistic lionfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a realistic emperorFish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a realistic sunfish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a realistic discusFish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a realistic neonTetra. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a realistic oscarFish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a cardinal tetra. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a tang fish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a clown fish. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.