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
@@ -393,26 +393,21 @@
self.destroy();
}
};
});
-var HealingPlant = AquariumDecorator.expand(function () {
- var self = AquariumDecorator.call(this);
+var HealingPlant = Container.expand(function () {
+ var self = Container.call(this);
var plantGraphics = self.createAsset('healingPlant', 'Healing Plant Graphics', 0.5, 1);
- self.healingRate = 0.1;
- self.interactWithFish = function (fish) {
- if (fish.size < self.size && self.distanceTo(fish) < 100) {
- fish.health = Math.min(fish.health + self.healingRate, 100);
- fish.isHidden = true;
- fish.alpha = 0.5;
- } else {
- fish.isHidden = false;
- fish.alpha = 1.0;
- }
- };
+ self.healingRate = 0.05;
self.on('tick', function () {
- var nearbyFish = self.getNearbyFishWithinRange(100);
- nearbyFish.forEach(self.interactWithFish);
+ var nearbyFish = self.getNearbyFishWithinRange(50);
+ nearbyFish.forEach(function (fish) {
+ if (fish.health < 100) {
+ fish.health = Math.min(fish.health + self.healingRate, 100);
+ }
+ });
});
+ return self;
});
var TreasureChest = InteractiveElement.expand(function () {
var self = InteractiveElement.call(this) || this;
var chestGraphics = self.createAsset('treasureChest', 'Treasure Chest Graphics', 0.5, 0.5);
@@ -428,26 +423,30 @@
}
};
LK.setInterval(self.performInteraction, 10000);
});
-var HealingAlgae = Container.expand(function () {
+var Algae = Container.expand(function () {
var self = Container.call(this);
- var algaeGraphics = self.createAsset('healingAlgae', 'Healing Algae Graphics', 0.5, 0.5);
- self.growthRate = 0.02;
- self.nutrition = 10;
- self.healingAmount = 2;
+ var algaeGraphics = self.createAsset('algae', 'Algae Graphics', 0.5, 1);
+ self.growthRate = 0.01;
+ self.nutritionValue = 5;
+ self.healthValue = 2;
self.on('tick', function () {
algaeGraphics.scale.x += self.growthRate;
algaeGraphics.scale.y += self.growthRate;
- self.nutrition += self.growthRate * 10;
- if (algaeGraphics.scale.x > 5) {
- self.destroy();
+ if (algaeGraphics.scale.x > 3) {
+ algaeGraphics.scale.x = 3;
+ algaeGraphics.scale.y = 3;
}
});
self.consume = function (fish) {
- fish.health = Math.min(fish.health + self.healingAmount, 100);
- self.destroy();
+ if (self.distanceTo(fish) < 50) {
+ fish.hunger = Math.min(fish.hunger + self.nutritionValue, 100);
+ fish.health = Math.min(fish.health + self.healthValue, 100);
+ self.destroy();
+ }
};
+ return self;
});
var MovingFood = Container.expand(function () {
var self = Container.call(this);
self.speed = 1;
@@ -580,33 +579,28 @@
};
return self;
});
var PredatorFish = Fish.expand(function () {
- var self = Fish.call(this) || this;
+ var self = Fish.call(this);
self.predatorGraphics = self.createAsset('predatorFish', 'Predator Fish Graphics', 0.5, 0.5);
- self.speed = (Math.random() * 0.5 + 1.5) / 3;
- self.huntRange = 300;
- self.hunt = function (prey) {
- if (self.distanceTo(prey) < self.huntRange) {
- self.targetRotation = Math.atan2(prey.y - self.y, prey.x - self.x);
- self.directionChangeTime = LK.ticks;
- self.directionChangeInterval = 3;
- prey.health -= 2;
- if (prey.health <= 0) {
- prey.die();
- }
- }
- };
- self.move = function () {
+ self.speed = 2;
+ self.huntRange = 200;
+ self.on('tick', function () {
var nearbyPrey = self.getNearbyFish().filter(function (fish) {
return fish.size < self.size && fish.health > 0;
});
if (nearbyPrey.length > 0) {
- self.hunt(nearbyPrey[0]);
+ var prey = nearbyPrey[0];
+ if (self.distanceTo(prey) < self.huntRange) {
+ self.targetRotation = Math.atan2(prey.y - self.y, prey.x - self.x);
+ prey.health -= 1;
+ if (prey.health <= 0) {
+ prey.destroy();
+ }
+ }
}
- Fish.prototype.move.call(self);
- };
- LK.setInterval(self.move, 500);
+ });
+ return self;
});
var RestingBehavior = Container.expand(function () {
var self = Container.call(this);
self.isResting = false;
@@ -1467,16 +1461,17 @@
};
});
var BubbleGenerator = Container.expand(function () {
var self = Container.call(this);
- self.bubbleRate = 500;
+ self.bubbleRate = 1000;
self.createBubble = function () {
var bubble = new Bubble();
bubble.x = Math.random() * 2048;
bubble.y = 2732;
- self.addChild(bubble);
+ LK.stageContainer.addChild(bubble);
};
LK.setInterval(self.createBubble, self.bubbleRate);
+ return self;
});
var RisingBubble = Container.expand(function () {
var self = Container.call(this);
self.liftSpeed = 3;
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.