User prompt
Fix Bug: 'Uncaught TypeError: this.addChild is not a function' in this line: 'self.cleanObject = function (obj, rate) {' Line Number: 272
User prompt
Fix Bug: 'Uncaught TypeError: this.addChild is not a function' in this line: 'self.cleanObject = function (obj, rate) {' Line Number: 272
User prompt
Fix Bug: 'Uncaught TypeError: this.addChild is not a function' in this line: 'self.cleanObject = function (obj, rate) {' Line Number: 272
User prompt
Fix Bug: 'Uncaught TypeError: this.addChild is not a function' in this line: 'self.update = function () {' Line Number: 260
User prompt
Fix Bug: 'Uncaught TypeError: this.addChild is not a function' in this line: 'self.update = function () {' Line Number: 260
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'var aquariumCleanerFish = self.addChild(new AquariumCleanerFish());' Line Number: 1463
User prompt
Improve the entire code with 6 new functionality
User prompt
Improve the entire code with 3 new functionality
User prompt
Improve the entire code with 2 new functionality
User prompt
Fix Bug: 'Uncaught ReferenceError: Plant is not defined' in this line: 'var HealingPlant = Plant.expand(function () {' Line Number: 324
User prompt
Improve the entire code with 3 new functionality
User prompt
Fix Bug: 'Uncaught ReferenceError: InteractiveDecoration is not defined' in this line: 'var InteractiveFeeder = InteractiveDecoration.expand(function () {' Line Number: 270
User prompt
Improve the entire code with 6 new functionality
User prompt
Fix Bug: 'ReferenceError: Bubble is not defined' in this line: 'var bubble = new Bubble();' Line Number: 1157
User prompt
Improve the entire code with 5 new functionality
User prompt
Fix Bug: 'Uncaught ReferenceError: InteractiveDecoration is not defined' in this line: 'var InteractiveFeeder = InteractiveDecoration.expand(function () {' Line Number: 251
User prompt
Improve the entire code with 3 new functionality
User prompt
Fix Bug: 'Uncaught ReferenceError: Food is not defined' in this line: 'var SpecialFood = Food.expand(function () {' Line Number: 321
User prompt
Improve the entire code with 3 new functionality
User prompt
Improve the entire code with 3 new functionality
User prompt
Fix Bug: 'Uncaught ReferenceError: Food is not defined' in this line: 'var MovingFood = Food.expand(function () {' Line Number: 301
User prompt
Improve the entire code with 3 new functionality
User prompt
Improve the entire code with 3 new functionality
User prompt
Fix Bug: 'Uncaught ReferenceError: Food is not defined' in this line: 'var SpecialFood = Food.expand(function () {' Line Number: 297
User prompt
Improve the entire code with 3 new functionality
===================================================================
--- original.js
+++ change.js
@@ -247,23 +247,37 @@
}
}
};
});
-var InteractiveDecoration = Container.expand(function () {
- var self = Container.call(this);
- self.interactWithFish = function (fish) {};
+var InteractiveFeeder = InteractiveDecoration.expand(function () {
+ var self = InteractiveDecoration.call(this) || this;
+ var feederGraphics = self.createAsset('interactiveFeeder', 'Interactive Feeder Graphics', 0.5, 0.5);
+ self.foodReleaseRate = 5;
+ self.interactWithFish = function (fish) {
+ if (fish.size < self.size && self.distanceTo(fish) < 100) {
+ var food = new Food();
+ food.x = self.x;
+ food.y = self.y - feederGraphics.height;
+ LK.stageContainer.addChild(food);
+ }
+ };
+ LK.setInterval(self.interactWithFish, 10000);
});
-var InteractivePlant = InteractiveDecoration.expand(function () {
+var HealingPlant = InteractiveDecoration.expand(function () {
var self = InteractiveDecoration.call(this) || this;
- var plantGraphics = self.createAsset('interactivePlant', 'Interactive Plant Graphics', 0.5, 1);
- self.size = 50;
- self.isHidingSpot = true;
+ 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;
}
};
+ LK.setInterval(self.interactWithFish, 1000);
});
var InteractiveElement = Container.expand(function () {
var self = Container.call(this);
self.interact = function () {};
@@ -398,29 +412,34 @@
self.interactWithDecorations();
Fish.prototype.move.call(self);
};
});
-var Predator = Fish.expand(function () {
+var HunterFish = Fish.expand(function () {
var self = Fish.call(this) || this;
- var predatorGraphics = self.createAsset('predator', 'Predator Graphics', .5, .5);
- self.speed = Math.random() * 0.3 + 0.6;
- self.huntRange = 200;
- self.chase = function (prey) {
+ var hunterGraphics = self.createAsset('hunterFish', 'Hunter Fish Graphics', .5, .5);
+ self.speed = Math.random() * 0.4 + 0.7;
+ 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 = 10;
+ self.directionChangeInterval = 5;
+ prey.health -= 0.5;
+ if (prey.health <= 0) {
+ prey.die();
+ }
}
};
self.move = function () {
var nearbyPrey = self.getNearbyFish().filter(function (fish) {
- return fish.size < self.size;
+ return fish.size < self.size && fish.health > 0;
});
if (nearbyPrey.length > 0) {
- self.chase(nearbyPrey[0]);
+ self.hunt(nearbyPrey[0]);
}
Fish.prototype.move.call(self);
};
+ LK.setInterval(self.move, 1000);
});
var RestingBehavior = Container.expand(function () {
var self = Container.call(this);
self.isResting = false;
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.