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
@@ -79,30 +79,34 @@
};
LK.setInterval(self.releaseFood, 10000);
return self;
});
-var Bubble = Container.expand(function () {
- var self = Container.call(this);
- self.liftSpeed = 3;
- self.on('tick', function () {
- self.y -= self.liftSpeed;
- if (self.y < 0) {
- self.destroy();
- }
- });
+var CapturingBubble = Bubble.expand(function () {
+ var self = Bubble.call(this) || this;
self.captureFish = function (fish) {
- if (!fish.isCaptured && self.intersects(fish)) {
+ if (fish instanceof Fish && !fish.isCaptured && self.intersects(fish)) {
fish.isCaptured = true;
fish.x = self.x;
fish.y = self.y - fish.height / 2;
+ fish.alpha = 0.5;
}
};
self.releaseFish = function (fish) {
if (fish.isCaptured) {
fish.isCaptured = false;
fish.y += fish.height / 2;
+ fish.alpha = 1.0;
}
};
+ self.on('tick', function () {
+ self.y -= self.liftSpeed;
+ if (self.y < 0) {
+ if (fish.isCaptured) {
+ self.releaseFish(fish);
+ }
+ self.destroy();
+ }
+ });
return self;
});
var BubbleProducingFish = Container.expand(function () {
var self = Container.call(this);
@@ -432,25 +436,20 @@
var InteractiveDecoration = InteractiveElement.expand(function () {
var self = InteractiveElement.call(this) || this;
self.interactWithFish = function (fish) {};
});
-var DecorativePlant = Container.expand(function () {
- var self = Container.call(this);
- self.growthRate = 0.02;
- self.nutritionValue = 10;
- self.healthValue = 5;
- var plantGraphics = self.createAsset('decorativePlant', 'Decorative Plant Graphics', 0.5, 1);
+var GrowingPlant = DecorativePlant.expand(function () {
+ var self = DecorativePlant.call(this) || this;
+ self.growthRate = 0.01;
+ self.maxScale = 5;
self.on('tick', function () {
- plantGraphics.scale.x += self.growthRate;
- plantGraphics.scale.y += self.growthRate;
- if (plantGraphics.scale.x > 4) {
- plantGraphics.scale.x = 4;
- plantGraphics.scale.y = 4;
+ if (self.scale.x < self.maxScale) {
+ self.scale.x += self.growthRate;
+ self.scale.y += self.growthRate;
}
});
self.consume = function (fish) {
- if (self.distanceTo(fish) < 100) {
- fish.hunger = Math.min(fish.hunger + self.nutritionValue, 100);
+ if (fish instanceof Fish && self.distanceTo(fish) < 100) {
fish.health = Math.min(fish.health + self.healthValue, 100);
self.destroy();
}
};
@@ -524,10 +523,20 @@
self.on('tick', function () {
self.move();
});
});
-var Food = Container.expand(function () {
- var self = Container.call(this);
+var SpeedyFood = Food.expand(function () {
+ var self = Food.call(this) || this;
+ self.nutrition = 10;
+ self.speedBoost = 1.5;
+ self.boostDuration = 5000;
+ self.consume = function (fish) {
+ if (fish instanceof Fish) {
+ fish.increaseSpeed(self.speedBoost, self.boostDuration);
+ }
+ Food.prototype.consume.call(this, fish);
+ };
+ return self;
});
var SmartFood = Food.expand(function () {
var self = Food.call(this) || this;
self.nutrition = 20;
@@ -646,9 +655,9 @@
};
return self;
});
var PredatorFish = Fish.expand(function () {
- var self = Fish.call(this);
+ var self = Fish.call(this) || this;
self.predatorGraphics = self.createAsset('predatorFish', 'Predator Fish Graphics', 0.5, 0.5);
self.speed = 3;
self.huntRange = 300;
self.hunt = function () {
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.