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
@@ -36,27 +36,11 @@
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;
+ self.x += Math.cos(self.rotation) * self.speed;
+ 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));
- var waterBounds = self.getWaterBounds();
- if (tentativeX < waterBounds.left || tentativeX > waterBounds.right || tentativeY < waterBounds.top || tentativeY > waterBounds.bottom) {
- self.x = Math.max(waterBounds.left, Math.min(centerX + Math.cos(angle) * distance, waterBounds.right));
- self.y = Math.max(waterBounds.top, Math.min(centerY + Math.sin(angle) * distance, waterBounds.bottom));
- } else {
- 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 {
- self.x = tentativeX;
- self.y = tentativeY;
- }
- }
- 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) {
@@ -70,9 +54,9 @@
var CelestialPearlDanio = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('celestialPearlDanio', 'Celestial Pearl Danio Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.35) * 2;
+ self.speed = Math.random() * 0.2 + 0.35;
self.move = function () {
if (!self.directionChangeTime || LK.ticks - self.directionChangeTime > self.directionChangeInterval) {
self.directionChangeTime = LK.ticks;
self.directionChangeInterval = Math.random() * 80 + 40;
@@ -83,16 +67,11 @@
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;
+ self.x += Math.cos(self.rotation) * self.speed;
+ 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();
if (self.x < waterBounds.left || self.x > waterBounds.right) {
self.rotation = Math.PI - self.rotation;
}
if (self.y < waterBounds.top || self.y > waterBounds.bottom) {
@@ -155,9 +134,9 @@
var Mandarinfish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('mandarinfish', 'Mandarinfish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.4) * 2;
+ self.speed = Math.random() * 0.2 + 0.4;
self.move = function () {};
});
var Lionfish = Fish.expand(function () {
var self = Fish.call(this);
@@ -169,9 +148,9 @@
var Surgeonfish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('surgeonfish', 'Surgeonfish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.5) * 2 * 2 * 2;
+ self.speed = (Math.random() * 0.2 + 0.5) * 2;
self.move = function () {
if (!self.directionChangeTime || LK.ticks - self.directionChangeTime > self.directionChangeInterval) {
self.directionChangeTime = LK.ticks;
self.directionChangeInterval = Math.random() * 120 + 60;
@@ -206,9 +185,9 @@
var Pufferfish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('pufferfish', 'Pufferfish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.4) * 2 * 2;
+ self.speed = Math.random() * 0.2 + 0.4;
self.move = function () {
if (!self.directionChangeTime || LK.ticks - self.directionChangeTime > self.directionChangeInterval) {
self.directionChangeTime = LK.ticks;
self.directionChangeInterval = Math.random() * 140 + 80;
@@ -241,9 +220,9 @@
var Clownfish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('clownfish', 'Clownfish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.4) * 2;
+ self.speed = Math.random() * 0.2 + 0.4;
self.move = function () {
if (!self.directionChangeTime || LK.ticks - self.directionChangeTime > self.directionChangeInterval) {
self.directionChangeTime = LK.ticks;
self.directionChangeInterval = Math.random() * 110 + 70;
@@ -320,20 +299,20 @@
aquariumGraphics.x = (2048 - aquariumGraphics.width) / 2;
aquariumGraphics.y = (2732 - aquariumGraphics.height) / 2;
self.addChild(aquariumGraphics);
var waterGraphics = self.createAsset('water', 'Water Graphics', 0, 0);
- waterGraphics.width = 2048 / 3 * 2 * 1.08 * 1.1;
- waterGraphics.height = 2732 / 3 * 1.26 * 1.1;
+ waterGraphics.width = 2048 / 3 * 2 * 1.08;
+ waterGraphics.height = 2732 / 3 * 1.26;
waterGraphics.x = (2048 - waterGraphics.width) / 2;
waterGraphics.y = (2732 - waterGraphics.height) / 2 - 150;
- waterGraphics.alpha = 0.3;
+ waterGraphics.alpha = 0.8;
self.addChild(waterGraphics);
});
var KoiFish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('koiFish', 'Koi Fish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.48) * 2;
+ self.speed = Math.random() * 0.2 + 0.48;
self.move = function () {
if (self.targetRotation === undefined || LK.ticks - self.rotationStartTime >= self.rotationDuration) {
self.targetRotation = Math.random() * Math.PI * 2;
self.rotationStartTime = LK.ticks;
@@ -374,9 +353,9 @@
var Goldfish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('goldfish', 'Goldfish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.4) * 2 * 2;
+ self.speed = Math.random() * 0.2 + 0.4;
self.move = function () {
if (self.targetRotation === undefined || LK.ticks - self.rotationStartTime >= self.rotationDuration) {
self.targetRotation = Math.random() * Math.PI * 2;
self.rotationStartTime = LK.ticks;
@@ -441,9 +420,9 @@
var GuppyFish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('guppyFish', 'Guppy Fish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.35) * 2 * 2;
+ self.speed = Math.random() * 0.2 + 0.35;
self.move = function () {
if (self.targetRotation === undefined || LK.ticks - self.rotationStartTime >= self.rotationDuration) {
self.targetRotation = Math.random() * Math.PI * 2;
self.rotationStartTime = LK.ticks;
@@ -513,9 +492,9 @@
var DiscusFish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('discusFish', 'Discus Fish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.45) * 2;
+ self.speed = Math.random() * 0.2 + 0.45;
self.move = function () {
if (self.targetRotation === undefined || LK.ticks - self.rotationStartTime >= self.rotationDuration) {
self.targetRotation = Math.random() * Math.PI * 2;
self.rotationStartTime = LK.ticks;
@@ -683,9 +662,9 @@
var PsychedelicFrogfish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('psychedelicFrogfish', 'Psychedelic Frogfish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.4) * 2 * 2;
+ self.speed = Math.random() * 0.2 + 0.4;
self.move = function () {};
});
var FlameScallop = Fish.expand(function () {
var self = Fish.call(this);
@@ -697,16 +676,16 @@
var RibbonEel = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('ribbonEel', 'Ribbon Eel Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.6) * 2;
+ self.speed = Math.random() * 0.2 + 0.6;
self.move = function () {};
});
var LeafySeaDragon = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('leafySeaDragon', 'Leafy Sea Dragon Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.4) * 2;
+ self.speed = Math.random() * 0.2 + 0.4;
self.move = function () {};
});
var ClownTriggerfish = Fish.expand(function () {
var self = Fish.call(this);
@@ -718,9 +697,9 @@
var ElectricBlueDamsel = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('electricBlueDamsel', 'Electric Blue Damsel Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.45) * 2;
+ self.speed = Math.random() * 0.2 + 0.45;
self.move = function () {};
});
var YellowTang = Fish.expand(function () {
var self = Fish.call(this);
@@ -732,9 +711,9 @@
var FlameHawkfish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('flameHawkfish', 'Flame Hawkfish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.48) * 2;
+ self.speed = Math.random() * 0.2 + 0.48;
self.move = function () {};
});
var RoyalGramma = Fish.expand(function () {
var self = Fish.call(this);
@@ -1004,9 +983,9 @@
var CometFish = Fish.expand(function () {
var self = Fish.call(this);
var fishGraphics = self.createAsset('cometFish', 'Comet Fish Graphics', .5, .5);
fishGraphics.scale.set(1, 1);
- self.speed = (Math.random() * 0.2 + 0.6) * 2;
+ self.speed = Math.random() * 0.2 + 0.6;
self.move = function () {
self.x += Math.cos(LK.ticks / 70) * self.speed;
self.y += Math.sin(LK.ticks / 70) * self.speed;
var waterBounds = self.getWaterBounds();
@@ -1069,9 +1048,9 @@
if (typeof fish.move === 'function') {
var waterBounds = aquarium.getWaterBounds();
var centerX = waterBounds.left + (waterBounds.right - waterBounds.left) / 2;
var centerY = waterBounds.top + (waterBounds.bottom - waterBounds.top) / 2;
- var maxDistance = 500;
+ var maxDistance = 600;
var angle = Math.random() * Math.PI * 2;
var distance = Math.random() * maxDistance;
fish.x = centerX + Math.cos(angle) * distance;
fish.y = centerY + Math.sin(angle) * distance;
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.