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
@@ -139,15 +139,25 @@
var self = Container.call(this);
self.decorate = function () {};
self.updateDecoration = function () {};
});
-var DecorativeCastle = AquariumDecorator.expand(function () {
- var self = AquariumDecorator.call(this) || this;
- var castleGraphics = self.createAsset('decorativeCastle', 'Decorative Castle Graphics', 0.5, 1);
- castleGraphics.width = 300;
- castleGraphics.height = 400;
+var HidingCastle = AquariumDecorator.expand(function () {
+ var self = AquariumDecorator.call(this);
+ self.castleGraphics = self.createAsset('decorativeCastle', 'Decorative Castle Graphics', 0.5, 1);
+ self.castleGraphics.width = 300;
+ self.castleGraphics.height = 400;
self.x = 1024;
- self.y = 2732 - castleGraphics.height / 2;
+ self.y = 2732 - self.castleGraphics.height / 2;
+ self.provideHiding = function (fish) {
+ if (fish.size < 30 && self.distanceTo(fish) < 100) {
+ fish.isHidden = true;
+ fish.alpha = 0.5;
+ } else {
+ fish.isHidden = false;
+ fish.alpha = 1.0;
+ }
+ };
+ return self;
});
var HidingBehavior = Container.expand(function () {
var self = Container.call(this);
self.hide = function (fish, castle) {
@@ -400,15 +410,14 @@
var Cleaner = Container.expand(function () {
var self = Container.call(this);
self.clean = function () {};
});
-var AquariumCleaner = Cleaner.expand(function () {
- var self = Cleaner.call(this) || this;
- var cleanerGraphics = self.createAsset('aquariumCleaner', 'Aquarium Cleaner Graphics', 0.5, 0.5);
+var CleaningRobot = Container.expand(function () {
+ var self = Container.call(this);
self.speed = 0.2;
self.cleaningRate = 1;
self.cleaningBehavior = new CleaningBehavior();
- self.update = function () {
+ self.moveAndClean = function () {
var dirtyObjects = self.cleaningBehavior.findDirtyObjects();
dirtyObjects.forEach(function (obj) {
self.x += (obj.x - self.x) * self.speed;
self.y += (obj.y - self.y) * self.speed;
@@ -416,8 +425,10 @@
self.cleaningBehavior.cleanObject(obj, self.cleaningRate);
}
});
};
+ LK.setInterval(self.moveAndClean, 1000);
+ return self;
});
var CleaningBehavior = Container.expand(function () {
var self = Container.call(this);
self.findDirtyObjects = function () {
@@ -629,22 +640,23 @@
self.destroy();
}
});
});
-var FeedingArea = Container.expand(function () {
+var FishFeeder = Container.expand(function () {
var self = Container.call(this);
- var areaGraphics = self.createAsset('feedingArea', 'Feeding Area Graphics', 0.5, 0.5);
- self.spawnFood = function () {
+ self.feedingRate = 5000;
+ self.feed = function () {
var food = new Food();
- food.x = self.x + (Math.random() - 0.5) * areaGraphics.width;
- food.y = self.y + (Math.random() - 0.5) * areaGraphics.height;
+ food.x = 1024;
+ food.y = 1366;
LK.stageContainer.addChild(food);
var nearbyFish = self.getNearbyFishWithinRange(500);
nearbyFish.forEach(function (fish) {
fish.rushToFood(food);
});
};
- LK.setInterval(self.spawnFood, 5000);
+ LK.setInterval(self.feed, self.feedingRate);
+ return self;
});
var IntelligentFishBehavior = Container.expand(function () {
var self = Container.call(this);
self.intelligenceLevel = 5;
@@ -1576,13 +1588,13 @@
}
fishGraphics.rotation = self.rotation;
};
});
-var BubbleGenerator = Container.expand(function (bubbleRate) {
+var BubbleMachine = Container.expand(function () {
var self = Container.call(this);
- self.bubbleRate = bubbleRate || 1000;
+ self.bubbleRate = 1000;
self.createBubble = function () {
- var bubble = new Bubble();
+ var bubble = new RisingBubble();
bubble.x = Math.random() * 2048;
bubble.y = 2732;
LK.stageContainer.addChild(bubble);
};
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.