User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'var fishGraphics = self.attachAsset('zebraDanio', {' Line Number: 116
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'var fishGraphics = self.attachAsset('zebraDanio', {' Line Number: 111
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'var fishGraphics = self.attachAsset('zebraDanio', {' Line Number: 106
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'var fishGraphics = self.attachAsset('zebraDanio', {' Line Number: 109
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'self.fishGraphics = self.attachAsset('zebraDanio', {' Line Number: 106
User prompt
Migrate to the latest version of LK
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'var fishGraphics = self.attachAsset('zebraDanio', {' Line Number: 106
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'self.fishGraphics = self.attachAsset('zebraDanio', {' Line Number: 106
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'var fishGraphics = self.attachAsset('zebraDanio', {' Line Number: 106
User prompt
Migrate to the latest version of LK
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'var fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 25
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'self.fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 25
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'self.fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 25
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'self.fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 52
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'var fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 169
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'self.fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 169
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'var fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 169
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'var fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 168
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'var fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 168
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'createAsset')' in this line: 'var fishGraphics = self.createAsset('zebraDanio', 'Zebra Danio Graphics', .5, .5);' Line Number: 168
User prompt
Improve the fluidity
User prompt
Make décoration 600 pixel up
User prompt
Move the décoration in the aquarium
User prompt
Fix Bug: 'Uncaught ReferenceError: aquarium is not defined' in this line: 'var waterBounds = aquarium.getWaterBounds();' Line Number: 1351
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'getWaterBounds')' in this line: 'var waterBounds = self.aquarium.getWaterBounds();' Line Number: 1255
===================================================================
--- original.js
+++ change.js
@@ -2,35 +2,8 @@
* Classes
****/
var Fish = Container.expand(function () {
var self = Container.call(this);
- self.move = function () {
- if (!self.directionChangeTime || LK.ticks - self.directionChangeTime > self.directionChangeInterval) {
- self.directionChangeTime = LK.ticks;
- self.directionChangeInterval = Math.random() * (self.maxChangeInterval - self.minChangeInterval) + self.minChangeInterval;
- self.targetRotation = Math.random() * Math.PI * 2;
- }
- var progress = (LK.ticks - self.directionChangeTime) / self.directionChangeInterval;
- if (progress < 1) {
- self.rotation += (self.targetRotation - self.rotation) * progress;
- } else {
- self.rotation = self.targetRotation;
- }
- var tentativeX = self.x + Math.cos(self.rotation) * self.speed;
- var tentativeY = self.y + Math.sin(self.rotation) * self.speed;
- var waterBounds = self.getWaterBounds();
- tentativeX = Math.max(waterBounds.left + 50, Math.min(tentativeX, waterBounds.right - 50));
- tentativeY = Math.max(waterBounds.top + 50, Math.min(tentativeY, waterBounds.bottom - 50));
- if (!self.isPathBlocked(tentativeX, tentativeY, self.getNearbyObstacles())) {
- self.x = tentativeX;
- self.y = tentativeY;
- } else {
- self.avoidObstacles(self.getNearbyObstacles());
- }
- self.rotation = self.rotation % (Math.PI * 2);
- self.fishGraphics.scale.x = Math.cos(self.rotation) < 0 ? -1 : 1;
- self.fishGraphics.rotation = self.rotation;
- };
self.avoidObstacles = function (obstacles) {};
self.isPathBlocked = function (newX, newY, obstacles) {
return false;
};
@@ -77,33 +50,19 @@
if (tentativeX < waterBounds.left || tentativeX > waterBounds.right || tentativeY < waterBounds.top || tentativeY > waterBounds.bottom) {
self.x = centerX + Math.cos(angle) * distance;
self.y = centerY + Math.sin(angle) * distance;
} else {
- if (!self.isPathBlocked(tentativeX, tentativeY, self.getNearbyObstacles())) {
- self.x = Math.max(waterBounds.left, Math.min(tentativeX, waterBounds.right));
- self.y = Math.max(waterBounds.top, Math.min(tentativeY, waterBounds.bottom));
- } else {
- self.avoidObstacles(self.getNearbyObstacles());
- }
+ self.x = tentativeX;
+ self.y = tentativeY;
}
}
var waterBounds = self.getWaterBounds();
- if (tentativeX < waterBounds.left) {
+ if (self.x < waterBounds.left || self.x > waterBounds.right) {
self.rotation = Math.PI - self.rotation;
- tentativeX = waterBounds.left;
}
- if (tentativeX > waterBounds.right) {
- self.rotation = Math.PI - self.rotation;
- tentativeX = waterBounds.right;
- }
- if (tentativeY < waterBounds.top) {
+ if (self.y < waterBounds.top || self.y > waterBounds.bottom) {
self.rotation = -self.rotation;
- tentativeY = waterBounds.top;
}
- if (tentativeY > waterBounds.bottom) {
- self.rotation = -self.rotation;
- tentativeY = waterBounds.bottom;
- }
self.rotation = self.rotation % (Math.PI * 2);
fishGraphics.scale.x = Math.cos(self.rotation) < 0 ? -1 : 1;
fishGraphics.rotation = self.rotation;
};
@@ -129,28 +88,17 @@
var tentativeY = self.y + Math.sin(self.rotation) * self.speed;
var waterBounds = self.getWaterBounds();
tentativeX = Math.max(waterBounds.left, Math.min(tentativeX, waterBounds.right));
tentativeY = Math.max(waterBounds.top, Math.min(tentativeY, waterBounds.bottom));
+ self.x = tentativeX;
+ self.y = tentativeY;
var waterBounds = self.getWaterBounds();
- self.x = Math.max(waterBounds.left, Math.min(self.x, waterBounds.right));
- self.y = Math.max(waterBounds.top, Math.min(self.y, waterBounds.bottom));
- var waterBounds = self.getWaterBounds();
- if (self.x <= waterBounds.left) {
+ if (self.x < waterBounds.left || self.x > waterBounds.right) {
self.rotation = Math.PI - self.rotation;
- self.x = waterBounds.left;
}
- if (self.x >= waterBounds.right) {
- self.rotation = Math.PI - self.rotation;
- self.x = waterBounds.right;
- }
- if (self.y <= waterBounds.top) {
+ if (self.y < waterBounds.top || self.y > waterBounds.bottom) {
self.rotation = -self.rotation;
- self.y = waterBounds.top;
}
- if (self.y >= waterBounds.bottom) {
- self.rotation = -self.rotation;
- self.y = waterBounds.bottom;
- }
self.rotation = self.rotation % (Math.PI * 2);
fishGraphics.scale.x = Math.cos(self.rotation) < 0 ? -1 : 1;
fishGraphics.rotation = self.rotation;
};
@@ -244,14 +192,14 @@
self.x = newX;
self.y = newY;
}
var waterBounds = self.getWaterBounds();
- var centerX = (waterBounds.left + waterBounds.right) / 2;
- var centerY = (waterBounds.top + waterBounds.bottom) / 2;
- if (self.x < waterBounds.left || self.x > waterBounds.right || self.y < waterBounds.top || self.y > waterBounds.bottom) {
- self.x = centerX;
- self.y = centerY;
+ if (self.x < waterBounds.left || self.x > waterBounds.right) {
+ self.rotation = Math.PI - self.rotation;
}
+ if (self.y < waterBounds.top || self.y > waterBounds.bottom) {
+ self.rotation = -self.rotation;
+ }
fishGraphics.scale.x = Math.cos(self.rotation) < 0 ? -1 : 1;
fishGraphics.rotation = self.rotation;
};
});
@@ -276,12 +224,11 @@
var tentativeY = self.y + Math.sin(self.rotation) * self.speed;
var waterBounds = self.getWaterBounds();
tentativeX = Math.max(waterBounds.left, Math.min(tentativeX, waterBounds.right));
tentativeY = Math.max(waterBounds.top, Math.min(tentativeY, waterBounds.bottom));
+ self.x = tentativeX;
+ self.y = tentativeY;
var waterBounds = self.getWaterBounds();
- self.x = Math.max(waterBounds.left, Math.min(tentativeX, waterBounds.right));
- self.y = Math.max(waterBounds.top, Math.min(tentativeY, waterBounds.bottom));
- var waterBounds = self.getWaterBounds();
if (self.x < waterBounds.left || self.x > waterBounds.right) {
self.rotation = Math.PI - self.rotation;
}
if (self.y < waterBounds.top || self.y > waterBounds.bottom) {
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.