User prompt
ekranın en aşağısında bir çanta olsun çantaya tuttuğumuz balıklar girsin çantaya bastığımızda ise karşımıza bir ekran çıksın ekranda tuttuğumuz balıklar ve yanındada fiyatları olsun ve birde kayığı sağdaki kulubenin tam yanına geldiğimizde kulubeye tıklarsak karşımıza bir ekran çıksın ekranın sol tarafında tuttuğumuz balıkları oraya satabileceğimiz bir yer sağda ise olta ve yem satın alabilelim tam 15 tane olta olsun oltalar seviyelerine göre pağalılaşsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
karakterimizin altında bir kayık olsun tuttuğumuz balıklar bu kayığa girsin kayık sürülebilsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
ekrandaki mavi gölün sağ ve solunada basınca oltayı sağa ve solada atsın sadece ortaya değil gölün her yerine etkileşim olsun
User prompt
aim falan olmasın mause ile gölün neresine 3 kez basarsak oraya atsın kancayı
User prompt
gölün herhangi bir yerine 3 kez bastığımızda kancayı oraya atsın
User prompt
Please fix the bug: 'storage.getInt is not a function' in or related to this line: 'var playerMoney = storage.getInt('playerMoney', 100);' Line Number: 239 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
balıkçı adamın sağında kulube olsun o kulubede yemler olsun yemlerin kalitesine göre fiyatı değişsin
User prompt
yeni 2 balık türü daha yap
Code edit (1 edits merged)
Please save this source code
User prompt
Lake Fishing Adventure
Initial prompt
bana bir göl yap ve bizim elimizdede bir olta olsun
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Fish = Container.expand(function (type) {
var self = Container.call(this);
self.fishType = type || 'small';
var fishAsset;
if (self.fishType === 'small') {
fishAsset = self.attachAsset('smallFish', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 1 + Math.random() * 2;
self.points = 10;
} else if (self.fishType === 'medium') {
fishAsset = self.attachAsset('mediumFish', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 0.5 + Math.random() * 1.5;
self.points = 25;
} else {
fishAsset = self.attachAsset('largeFish', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 0.3 + Math.random() * 1;
self.points = 50;
}
self.directionX = Math.random() > 0.5 ? 1 : -1;
self.directionY = (Math.random() - 0.5) * 0.5;
self.startX = self.x;
self.swimDistance = 300 + Math.random() * 400;
self.update = function () {
self.x += self.speed * self.directionX;
self.y += self.speed * self.directionY;
// Turn around if swam too far
if (Math.abs(self.x - self.startX) > self.swimDistance) {
self.directionX *= -1;
fishAsset.scaleX = self.directionX;
self.startX = self.x;
}
// Keep fish in water bounds
if (self.x < 50) {
self.x = 50;
self.directionX = 1;
fishAsset.scaleX = 1;
}
if (self.x > 1998) {
self.x = 1998;
self.directionX = -1;
fishAsset.scaleX = -1;
}
if (self.y < waterSurface + 100) {
self.y = waterSurface + 100;
self.directionY = Math.abs(self.directionY);
}
if (self.y > waterSurface + 1200) {
self.y = waterSurface + 1200;
self.directionY = -Math.abs(self.directionY);
}
};
return self;
});
var FishingLine = Container.expand(function () {
var self = Container.call(this);
self.lineGraphics = self.attachAsset('fishingLine', {
anchorX: 0.5,
anchorY: 0
});
self.hook = self.addChild(new Container());
self.hookGraphics = self.hook.attachAsset('hook', {
anchorX: 0.5,
anchorY: 0.5
});
self.bobber = self.addChild(new Container());
self.bobberGraphics = self.bobber.attachAsset('bobber', {
anchorX: 0.5,
anchorY: 0.5
});
self.isVisible = false;
self.visible = false;
self.showLine = function (startX, startY, endX, endY) {
self.x = startX;
self.y = startY;
var distance = Math.sqrt((endX - startX) * (endX - startX) + (endY - startY) * (endY - startY));
var angle = Math.atan2(endY - startY, endX - startX);
self.lineGraphics.height = distance;
self.lineGraphics.rotation = angle + Math.PI / 2;
self.hook.x = 0;
self.hook.y = distance;
self.bobber.x = 0;
self.bobber.y = distance - 20;
self.isVisible = true;
self.visible = true;
};
self.hideLine = function () {
self.isVisible = false;
self.visible = false;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Game variables
var waterSurface = 600;
var fish = [];
var isCasting = false;
var isReeling = false;
var castStartX = 0;
var castStartY = 0;
var hookedFish = null;
var reelProgress = 0;
// Create water
var water = game.addChild(LK.getAsset('water', {
anchorX: 0,
anchorY: 0,
x: 0,
y: waterSurface
}));
// Create player
var player = game.addChild(LK.getAsset('player', {
anchorX: 0.5,
anchorY: 1,
x: 1024,
y: waterSurface
}));
// Create fishing rod
var fishingRod = game.addChild(LK.getAsset('fishingRod', {
anchorX: 0.5,
anchorY: 1,
x: 1024,
y: waterSurface - 50
}));
// Create fishing line
var fishingLine = game.addChild(new FishingLine());
// Create UI
var scoreTxt = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var instructionTxt = new Text2('Drag to aim, release to cast!', {
size: 40,
fill: 0xFFFFFF
});
instructionTxt.anchor.set(0.5, 0);
instructionTxt.y = 80;
LK.gui.top.addChild(instructionTxt);
// Spawn initial fish
function spawnFish() {
var fishType;
var rand = Math.random();
if (rand < 0.6) {
fishType = 'small';
} else if (rand < 0.85) {
fishType = 'medium';
} else {
fishType = 'large';
}
var newFish = game.addChild(new Fish(fishType));
newFish.x = Math.random() * 1948 + 50;
newFish.y = waterSurface + 150 + Math.random() * 1000;
newFish.startX = newFish.x;
fish.push(newFish);
}
// Spawn initial fish
for (var i = 0; i < 8; i++) {
spawnFish();
}
// Cast fishing line
function castLine(targetX, targetY) {
if (isCasting || isReeling) return;
isCasting = true;
var rodTipX = fishingRod.x;
var rodTipY = fishingRod.y - 180;
fishingLine.showLine(rodTipX, rodTipY, targetX, targetY);
LK.getSound('cast').play();
// Animate casting
tween(fishingRod, {
rotation: Math.PI / 6
}, {
duration: 200
});
LK.setTimeout(function () {
LK.getSound('splash').play();
// Check if hook is near any fish
checkForFish(targetX, targetY);
LK.setTimeout(function () {
if (!hookedFish) {
reelIn();
}
}, 2000);
}, 300);
}
// Check if hook caught a fish
function checkForFish(hookX, hookY) {
for (var i = 0; i < fish.length; i++) {
var currentFish = fish[i];
var distance = Math.sqrt((currentFish.x - hookX) * (currentFish.x - hookX) + (currentFish.y - hookY) * (currentFish.y - hookY));
if (distance < 60) {
hookedFish = currentFish;
reelProgress = 0;
isReeling = true;
LK.getSound('catch').play();
instructionTxt.setText('Tap rapidly to reel in!');
// Flash the hooked fish
LK.effects.flashObject(hookedFish, 0xFFFF00, 500);
break;
}
}
}
// Reel in the line
function reelIn() {
if (hookedFish) {
// Increase score
LK.setScore(LK.getScore() + hookedFish.points);
scoreTxt.setText('Score: ' + LK.getScore());
// Remove fish
for (var i = fish.length - 1; i >= 0; i--) {
if (fish[i] === hookedFish) {
fish[i].destroy();
fish.splice(i, 1);
break;
}
}
// Spawn new fish
spawnFish();
hookedFish = null;
reelProgress = 0;
}
// Reset fishing state
fishingLine.hideLine();
tween(fishingRod, {
rotation: 0
}, {
duration: 300
});
isCasting = false;
isReeling = false;
instructionTxt.setText('Drag to aim, release to cast!');
}
// Game events
game.down = function (x, y, obj) {
if (isReeling && hookedFish) {
reelProgress += 20;
if (reelProgress >= 100) {
reelIn();
}
return;
}
if (!isCasting && !isReeling) {
castStartX = x;
castStartY = y;
}
};
game.up = function (x, y, obj) {
if (!isCasting && !isReeling && Math.abs(x - castStartX) > 50) {
// Only cast if in water area
if (y > waterSurface) {
castLine(x, y);
}
}
};
// Spawn new fish periodically
var fishSpawnTimer = 0;
game.update = function () {
// Update all fish
for (var i = 0; i < fish.length; i++) {
fish[i].update();
}
// Spawn new fish occasionally
fishSpawnTimer++;
if (fishSpawnTimer > 600 && fish.length < 12) {
// Every 10 seconds at 60fps
spawnFish();
fishSpawnTimer = 0;
}
// Move hooked fish towards rod
if (hookedFish && isReeling) {
var targetX = fishingRod.x;
var targetY = fishingRod.y - 100;
var moveSpeed = 0.02;
hookedFish.x += (targetX - hookedFish.x) * moveSpeed;
hookedFish.y += (targetY - hookedFish.y) * moveSpeed;
// Auto-reel if fish gets close enough
var distance = Math.sqrt((hookedFish.x - targetX) * (hookedFish.x - targetX) + (hookedFish.y - targetY) * (hookedFish.y - targetY));
if (distance < 50) {
reelIn();
}
}
};
// Play ambient music
LK.playMusic('ambience'); ===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,309 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Fish = Container.expand(function (type) {
+ var self = Container.call(this);
+ self.fishType = type || 'small';
+ var fishAsset;
+ if (self.fishType === 'small') {
+ fishAsset = self.attachAsset('smallFish', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 1 + Math.random() * 2;
+ self.points = 10;
+ } else if (self.fishType === 'medium') {
+ fishAsset = self.attachAsset('mediumFish', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 0.5 + Math.random() * 1.5;
+ self.points = 25;
+ } else {
+ fishAsset = self.attachAsset('largeFish', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 0.3 + Math.random() * 1;
+ self.points = 50;
+ }
+ self.directionX = Math.random() > 0.5 ? 1 : -1;
+ self.directionY = (Math.random() - 0.5) * 0.5;
+ self.startX = self.x;
+ self.swimDistance = 300 + Math.random() * 400;
+ self.update = function () {
+ self.x += self.speed * self.directionX;
+ self.y += self.speed * self.directionY;
+ // Turn around if swam too far
+ if (Math.abs(self.x - self.startX) > self.swimDistance) {
+ self.directionX *= -1;
+ fishAsset.scaleX = self.directionX;
+ self.startX = self.x;
+ }
+ // Keep fish in water bounds
+ if (self.x < 50) {
+ self.x = 50;
+ self.directionX = 1;
+ fishAsset.scaleX = 1;
+ }
+ if (self.x > 1998) {
+ self.x = 1998;
+ self.directionX = -1;
+ fishAsset.scaleX = -1;
+ }
+ if (self.y < waterSurface + 100) {
+ self.y = waterSurface + 100;
+ self.directionY = Math.abs(self.directionY);
+ }
+ if (self.y > waterSurface + 1200) {
+ self.y = waterSurface + 1200;
+ self.directionY = -Math.abs(self.directionY);
+ }
+ };
+ return self;
+});
+var FishingLine = Container.expand(function () {
+ var self = Container.call(this);
+ self.lineGraphics = self.attachAsset('fishingLine', {
+ anchorX: 0.5,
+ anchorY: 0
+ });
+ self.hook = self.addChild(new Container());
+ self.hookGraphics = self.hook.attachAsset('hook', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.bobber = self.addChild(new Container());
+ self.bobberGraphics = self.bobber.attachAsset('bobber', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.isVisible = false;
+ self.visible = false;
+ self.showLine = function (startX, startY, endX, endY) {
+ self.x = startX;
+ self.y = startY;
+ var distance = Math.sqrt((endX - startX) * (endX - startX) + (endY - startY) * (endY - startY));
+ var angle = Math.atan2(endY - startY, endX - startX);
+ self.lineGraphics.height = distance;
+ self.lineGraphics.rotation = angle + Math.PI / 2;
+ self.hook.x = 0;
+ self.hook.y = distance;
+ self.bobber.x = 0;
+ self.bobber.y = distance - 20;
+ self.isVisible = true;
+ self.visible = true;
+ };
+ self.hideLine = function () {
+ self.isVisible = false;
+ self.visible = false;
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x87CEEB
+});
+
+/****
+* Game Code
+****/
+// Game variables
+var waterSurface = 600;
+var fish = [];
+var isCasting = false;
+var isReeling = false;
+var castStartX = 0;
+var castStartY = 0;
+var hookedFish = null;
+var reelProgress = 0;
+// Create water
+var water = game.addChild(LK.getAsset('water', {
+ anchorX: 0,
+ anchorY: 0,
+ x: 0,
+ y: waterSurface
+}));
+// Create player
+var player = game.addChild(LK.getAsset('player', {
+ anchorX: 0.5,
+ anchorY: 1,
+ x: 1024,
+ y: waterSurface
+}));
+// Create fishing rod
+var fishingRod = game.addChild(LK.getAsset('fishingRod', {
+ anchorX: 0.5,
+ anchorY: 1,
+ x: 1024,
+ y: waterSurface - 50
+}));
+// Create fishing line
+var fishingLine = game.addChild(new FishingLine());
+// Create UI
+var scoreTxt = new Text2('Score: 0', {
+ size: 60,
+ fill: 0xFFFFFF
+});
+scoreTxt.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreTxt);
+var instructionTxt = new Text2('Drag to aim, release to cast!', {
+ size: 40,
+ fill: 0xFFFFFF
+});
+instructionTxt.anchor.set(0.5, 0);
+instructionTxt.y = 80;
+LK.gui.top.addChild(instructionTxt);
+// Spawn initial fish
+function spawnFish() {
+ var fishType;
+ var rand = Math.random();
+ if (rand < 0.6) {
+ fishType = 'small';
+ } else if (rand < 0.85) {
+ fishType = 'medium';
+ } else {
+ fishType = 'large';
+ }
+ var newFish = game.addChild(new Fish(fishType));
+ newFish.x = Math.random() * 1948 + 50;
+ newFish.y = waterSurface + 150 + Math.random() * 1000;
+ newFish.startX = newFish.x;
+ fish.push(newFish);
+}
+// Spawn initial fish
+for (var i = 0; i < 8; i++) {
+ spawnFish();
+}
+// Cast fishing line
+function castLine(targetX, targetY) {
+ if (isCasting || isReeling) return;
+ isCasting = true;
+ var rodTipX = fishingRod.x;
+ var rodTipY = fishingRod.y - 180;
+ fishingLine.showLine(rodTipX, rodTipY, targetX, targetY);
+ LK.getSound('cast').play();
+ // Animate casting
+ tween(fishingRod, {
+ rotation: Math.PI / 6
+ }, {
+ duration: 200
+ });
+ LK.setTimeout(function () {
+ LK.getSound('splash').play();
+ // Check if hook is near any fish
+ checkForFish(targetX, targetY);
+ LK.setTimeout(function () {
+ if (!hookedFish) {
+ reelIn();
+ }
+ }, 2000);
+ }, 300);
+}
+// Check if hook caught a fish
+function checkForFish(hookX, hookY) {
+ for (var i = 0; i < fish.length; i++) {
+ var currentFish = fish[i];
+ var distance = Math.sqrt((currentFish.x - hookX) * (currentFish.x - hookX) + (currentFish.y - hookY) * (currentFish.y - hookY));
+ if (distance < 60) {
+ hookedFish = currentFish;
+ reelProgress = 0;
+ isReeling = true;
+ LK.getSound('catch').play();
+ instructionTxt.setText('Tap rapidly to reel in!');
+ // Flash the hooked fish
+ LK.effects.flashObject(hookedFish, 0xFFFF00, 500);
+ break;
+ }
+ }
+}
+// Reel in the line
+function reelIn() {
+ if (hookedFish) {
+ // Increase score
+ LK.setScore(LK.getScore() + hookedFish.points);
+ scoreTxt.setText('Score: ' + LK.getScore());
+ // Remove fish
+ for (var i = fish.length - 1; i >= 0; i--) {
+ if (fish[i] === hookedFish) {
+ fish[i].destroy();
+ fish.splice(i, 1);
+ break;
+ }
+ }
+ // Spawn new fish
+ spawnFish();
+ hookedFish = null;
+ reelProgress = 0;
+ }
+ // Reset fishing state
+ fishingLine.hideLine();
+ tween(fishingRod, {
+ rotation: 0
+ }, {
+ duration: 300
+ });
+ isCasting = false;
+ isReeling = false;
+ instructionTxt.setText('Drag to aim, release to cast!');
+}
+// Game events
+game.down = function (x, y, obj) {
+ if (isReeling && hookedFish) {
+ reelProgress += 20;
+ if (reelProgress >= 100) {
+ reelIn();
+ }
+ return;
+ }
+ if (!isCasting && !isReeling) {
+ castStartX = x;
+ castStartY = y;
+ }
+};
+game.up = function (x, y, obj) {
+ if (!isCasting && !isReeling && Math.abs(x - castStartX) > 50) {
+ // Only cast if in water area
+ if (y > waterSurface) {
+ castLine(x, y);
+ }
+ }
+};
+// Spawn new fish periodically
+var fishSpawnTimer = 0;
+game.update = function () {
+ // Update all fish
+ for (var i = 0; i < fish.length; i++) {
+ fish[i].update();
+ }
+ // Spawn new fish occasionally
+ fishSpawnTimer++;
+ if (fishSpawnTimer > 600 && fish.length < 12) {
+ // Every 10 seconds at 60fps
+ spawnFish();
+ fishSpawnTimer = 0;
+ }
+ // Move hooked fish towards rod
+ if (hookedFish && isReeling) {
+ var targetX = fishingRod.x;
+ var targetY = fishingRod.y - 100;
+ var moveSpeed = 0.02;
+ hookedFish.x += (targetX - hookedFish.x) * moveSpeed;
+ hookedFish.y += (targetY - hookedFish.y) * moveSpeed;
+ // Auto-reel if fish gets close enough
+ var distance = Math.sqrt((hookedFish.x - targetX) * (hookedFish.x - targetX) + (hookedFish.y - targetY) * (hookedFish.y - targetY));
+ if (distance < 50) {
+ reelIn();
+ }
+ }
+};
+// Play ambient music
+LK.playMusic('ambience');
\ No newline at end of file
yeşil balık. In-Game asset. 2d. High contrast. No shadows
gri balık sinirli. In-Game asset. 2d. High contrast. No shadows
olta. In-Game asset. 2d. High contrast. No shadows
mavi hamsi. In-Game asset. 2d. High contrast. No shadows
sarı balık. In-Game asset. 2d. High contrast. No shadows
gri büyük balık. In-Game asset. 2d. High contrast. No shadows
kayık. In-Game asset. 2d. High contrast. No shadows
çanta. In-Game asset. 2d. High contrast. No shadows
çatısız kulübe ama dümdüz ekrana bakan. In-Game asset. 2d. High contrast. No shadows
ahşap çatı ama dümdüz ekrana bakan. In-Game asset. 2d. High contrast. No shadows
palyaço balığı. In-Game asset. 2d. High contrast. No shadows
melek balığı. In-Game asset. 2d. High contrast. No shadows
yosun. In-Game asset. 2d. High contrast. No shadows
baloncuk açık renk. In-Game asset. 2d. High contrast. No shadows
bulut. In-Game asset. 2d. High contrast. No shadows
balıkçı ama elinde hiç bir şey olmasın. In-Game asset. 2d. High contrast. No shadows
çakıl taşı. In-Game asset. 2d. High contrast. No shadows