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");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Bait = Container.expand(function (type) {
var self = Container.call(this);
self.baitType = type || 'basic';
var baitAsset;
if (self.baitType === 'basic') {
baitAsset = self.attachAsset('basicBait', {
anchorX: 0.5,
anchorY: 0.5
});
self.price = 10;
self.catchChance = 1.0;
self.name = 'Basic Bait';
} else if (self.baitType === 'premium') {
baitAsset = self.attachAsset('premiumBait', {
anchorX: 0.5,
anchorY: 0.5
});
self.price = 25;
self.catchChance = 1.5;
self.name = 'Premium Bait';
} else if (self.baitType === 'golden') {
baitAsset = self.attachAsset('goldenBait', {
anchorX: 0.5,
anchorY: 0.5
});
self.price = 50;
self.catchChance = 2.0;
self.name = 'Golden Bait';
}
return self;
});
var Cabin = Container.expand(function () {
var self = Container.call(this);
// Cabin structure
var cabin = self.attachAsset('cabin', {
anchorX: 0.5,
anchorY: 1
});
var roof = self.attachAsset('cabinRoof', {
anchorX: 0.5,
anchorY: 1,
y: -180
});
var door = self.attachAsset('cabinDoor', {
anchorX: 0.5,
anchorY: 1,
y: -50
});
// Bait displays
self.basicBaitDisplay = self.addChild(new Bait('basic'));
self.basicBaitDisplay.x = -60;
self.basicBaitDisplay.y = -140;
self.premiumBaitDisplay = self.addChild(new Bait('premium'));
self.premiumBaitDisplay.x = -20;
self.premiumBaitDisplay.y = -140;
self.goldenBaitDisplay = self.addChild(new Bait('golden'));
self.goldenBaitDisplay.x = 20;
self.goldenBaitDisplay.y = -140;
// Make baits interactive
self.basicBaitDisplay.down = function () {
purchaseBait('basic');
};
self.premiumBaitDisplay.down = function () {
purchaseBait('premium');
};
self.goldenBaitDisplay.down = function () {
purchaseBait('golden');
};
return self;
});
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 if (self.fishType === 'tropical') {
fishAsset = self.attachAsset('tropicalFish', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 1.5 + Math.random() * 2;
self.points = 35;
} else if (self.fishType === 'rare') {
fishAsset = self.attachAsset('rareFish', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 0.2 + Math.random() * 0.8;
self.points = 100;
} 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;
// Bait system variables
var playerMoney = storage.getInt('playerMoney', 100);
var currentBait = 'basic';
var baitCount = {
basic: storage.getInt('basicBait', 5),
premium: storage.getInt('premiumBait', 0),
golden: storage.getInt('goldenBait', 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 cabin on the right side
var cabin = game.addChild(new Cabin());
cabin.x = 1600;
cabin.y = waterSurface;
// 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);
var moneyTxt = new Text2('Money: ' + playerMoney, {
size: 50,
fill: 0xFFD700
});
moneyTxt.anchor.set(1, 0);
LK.gui.topRight.addChild(moneyTxt);
var baitTxt = new Text2('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')', {
size: 40,
fill: 0xFFFFFF
});
baitTxt.anchor.set(1, 0);
baitTxt.y = 60;
LK.gui.topRight.addChild(baitTxt);
var cabinInfoTxt = new Text2('Visit cabin to buy baits!\nBasic: 10 Premium: 25 Golden: 50', {
size: 30,
fill: 0xFFFFFF
});
cabinInfoTxt.anchor.set(0, 1);
cabinInfoTxt.y = -20;
LK.gui.bottomLeft.addChild(cabinInfoTxt);
// Purchase bait function
function purchaseBait(baitType) {
var bait = new Bait(baitType);
if (playerMoney >= bait.price) {
playerMoney -= bait.price;
baitCount[baitType] += 1;
// Save to storage
storage.setInt('playerMoney', playerMoney);
storage.setInt(baitType + 'Bait', baitCount[baitType]);
// Update UI
moneyTxt.setText('Money: ' + playerMoney);
baitTxt.setText('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')');
instructionTxt.setText('Bought ' + bait.name + '!');
LK.setTimeout(function () {
instructionTxt.setText('Drag to aim, release to cast!');
}, 1500);
} else {
instructionTxt.setText('Not enough money!');
LK.setTimeout(function () {
instructionTxt.setText('Drag to aim, release to cast!');
}, 1500);
}
}
// Switch bait function
function switchBait() {
var baitTypes = ['basic', 'premium', 'golden'];
var currentIndex = baitTypes.indexOf(currentBait);
for (var i = 1; i <= baitTypes.length; i++) {
var nextIndex = (currentIndex + i) % baitTypes.length;
var nextBait = baitTypes[nextIndex];
if (baitCount[nextBait] > 0) {
currentBait = nextBait;
baitTxt.setText('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')');
break;
}
}
}
// Spawn initial fish
function spawnFish() {
var fishType;
var rand = Math.random();
if (rand < 0.4) {
fishType = 'small';
} else if (rand < 0.65) {
fishType = 'medium';
} else if (rand < 0.8) {
fishType = 'tropical';
} else if (rand < 0.95) {
fishType = 'large';
} else {
fishType = 'rare';
}
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;
if (baitCount[currentBait] <= 0) {
instructionTxt.setText('No bait! Visit the cabin to buy more.');
LK.setTimeout(function () {
instructionTxt.setText('Drag to aim, release to cast!');
}, 2000);
return;
}
isCasting = true;
// Use bait
baitCount[currentBait] -= 1;
storage.setInt(currentBait + 'Bait', baitCount[currentBait]);
baitTxt.setText('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')');
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) {
var bait = new Bait(currentBait);
var catchRadius = 60 * bait.catchChance;
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 < catchRadius) {
// Better bait increases chance of catching rare fish
var catchChance = Math.random() * bait.catchChance;
if (catchChance > 0.5 || currentFish.fishType !== 'rare') {
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());
// Give money based on fish value
var moneyEarned = Math.floor(hookedFish.points / 2);
playerMoney += moneyEarned;
storage.setInt('playerMoney', playerMoney);
moneyTxt.setText('Money: ' + playerMoney);
// 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;
}
// Switch bait on tap (when not casting or reeling)
if (!isCasting && !isReeling && x > 1500) {
switchBait();
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,12 +1,83 @@
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
+var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
+var Bait = Container.expand(function (type) {
+ var self = Container.call(this);
+ self.baitType = type || 'basic';
+ var baitAsset;
+ if (self.baitType === 'basic') {
+ baitAsset = self.attachAsset('basicBait', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.price = 10;
+ self.catchChance = 1.0;
+ self.name = 'Basic Bait';
+ } else if (self.baitType === 'premium') {
+ baitAsset = self.attachAsset('premiumBait', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.price = 25;
+ self.catchChance = 1.5;
+ self.name = 'Premium Bait';
+ } else if (self.baitType === 'golden') {
+ baitAsset = self.attachAsset('goldenBait', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.price = 50;
+ self.catchChance = 2.0;
+ self.name = 'Golden Bait';
+ }
+ return self;
+});
+var Cabin = Container.expand(function () {
+ var self = Container.call(this);
+ // Cabin structure
+ var cabin = self.attachAsset('cabin', {
+ anchorX: 0.5,
+ anchorY: 1
+ });
+ var roof = self.attachAsset('cabinRoof', {
+ anchorX: 0.5,
+ anchorY: 1,
+ y: -180
+ });
+ var door = self.attachAsset('cabinDoor', {
+ anchorX: 0.5,
+ anchorY: 1,
+ y: -50
+ });
+ // Bait displays
+ self.basicBaitDisplay = self.addChild(new Bait('basic'));
+ self.basicBaitDisplay.x = -60;
+ self.basicBaitDisplay.y = -140;
+ self.premiumBaitDisplay = self.addChild(new Bait('premium'));
+ self.premiumBaitDisplay.x = -20;
+ self.premiumBaitDisplay.y = -140;
+ self.goldenBaitDisplay = self.addChild(new Bait('golden'));
+ self.goldenBaitDisplay.x = 20;
+ self.goldenBaitDisplay.y = -140;
+ // Make baits interactive
+ self.basicBaitDisplay.down = function () {
+ purchaseBait('basic');
+ };
+ self.premiumBaitDisplay.down = function () {
+ purchaseBait('premium');
+ };
+ self.goldenBaitDisplay.down = function () {
+ purchaseBait('golden');
+ };
+ return self;
+});
var Fish = Container.expand(function (type) {
var self = Container.call(this);
self.fishType = type || 'small';
var fishAsset;
@@ -138,8 +209,16 @@
var castStartX = 0;
var castStartY = 0;
var hookedFish = null;
var reelProgress = 0;
+// Bait system variables
+var playerMoney = storage.getInt('playerMoney', 100);
+var currentBait = 'basic';
+var baitCount = {
+ basic: storage.getInt('basicBait', 5),
+ premium: storage.getInt('premiumBait', 0),
+ golden: storage.getInt('goldenBait', 0)
+};
// Create water
var water = game.addChild(LK.getAsset('water', {
anchorX: 0,
anchorY: 0,
@@ -161,8 +240,12 @@
y: waterSurface - 50
}));
// Create fishing line
var fishingLine = game.addChild(new FishingLine());
+// Create cabin on the right side
+var cabin = game.addChild(new Cabin());
+cabin.x = 1600;
+cabin.y = waterSurface;
// Create UI
var scoreTxt = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
@@ -175,8 +258,65 @@
});
instructionTxt.anchor.set(0.5, 0);
instructionTxt.y = 80;
LK.gui.top.addChild(instructionTxt);
+var moneyTxt = new Text2('Money: ' + playerMoney, {
+ size: 50,
+ fill: 0xFFD700
+});
+moneyTxt.anchor.set(1, 0);
+LK.gui.topRight.addChild(moneyTxt);
+var baitTxt = new Text2('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')', {
+ size: 40,
+ fill: 0xFFFFFF
+});
+baitTxt.anchor.set(1, 0);
+baitTxt.y = 60;
+LK.gui.topRight.addChild(baitTxt);
+var cabinInfoTxt = new Text2('Visit cabin to buy baits!\nBasic: 10 Premium: 25 Golden: 50', {
+ size: 30,
+ fill: 0xFFFFFF
+});
+cabinInfoTxt.anchor.set(0, 1);
+cabinInfoTxt.y = -20;
+LK.gui.bottomLeft.addChild(cabinInfoTxt);
+// Purchase bait function
+function purchaseBait(baitType) {
+ var bait = new Bait(baitType);
+ if (playerMoney >= bait.price) {
+ playerMoney -= bait.price;
+ baitCount[baitType] += 1;
+ // Save to storage
+ storage.setInt('playerMoney', playerMoney);
+ storage.setInt(baitType + 'Bait', baitCount[baitType]);
+ // Update UI
+ moneyTxt.setText('Money: ' + playerMoney);
+ baitTxt.setText('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')');
+ instructionTxt.setText('Bought ' + bait.name + '!');
+ LK.setTimeout(function () {
+ instructionTxt.setText('Drag to aim, release to cast!');
+ }, 1500);
+ } else {
+ instructionTxt.setText('Not enough money!');
+ LK.setTimeout(function () {
+ instructionTxt.setText('Drag to aim, release to cast!');
+ }, 1500);
+ }
+}
+// Switch bait function
+function switchBait() {
+ var baitTypes = ['basic', 'premium', 'golden'];
+ var currentIndex = baitTypes.indexOf(currentBait);
+ for (var i = 1; i <= baitTypes.length; i++) {
+ var nextIndex = (currentIndex + i) % baitTypes.length;
+ var nextBait = baitTypes[nextIndex];
+ if (baitCount[nextBait] > 0) {
+ currentBait = nextBait;
+ baitTxt.setText('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')');
+ break;
+ }
+ }
+}
// Spawn initial fish
function spawnFish() {
var fishType;
var rand = Math.random();
@@ -203,9 +343,20 @@
}
// Cast fishing line
function castLine(targetX, targetY) {
if (isCasting || isReeling) return;
+ if (baitCount[currentBait] <= 0) {
+ instructionTxt.setText('No bait! Visit the cabin to buy more.');
+ LK.setTimeout(function () {
+ instructionTxt.setText('Drag to aim, release to cast!');
+ }, 2000);
+ return;
+ }
isCasting = true;
+ // Use bait
+ baitCount[currentBait] -= 1;
+ storage.setInt(currentBait + 'Bait', baitCount[currentBait]);
+ baitTxt.setText('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')');
var rodTipX = fishingRod.x;
var rodTipY = fishingRod.y - 180;
fishingLine.showLine(rodTipX, rodTipY, targetX, targetY);
LK.getSound('cast').play();
@@ -227,20 +378,26 @@
}, 300);
}
// Check if hook caught a fish
function checkForFish(hookX, hookY) {
+ var bait = new Bait(currentBait);
+ var catchRadius = 60 * bait.catchChance;
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;
+ if (distance < catchRadius) {
+ // Better bait increases chance of catching rare fish
+ var catchChance = Math.random() * bait.catchChance;
+ if (catchChance > 0.5 || currentFish.fishType !== 'rare') {
+ 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
@@ -248,8 +405,13 @@
if (hookedFish) {
// Increase score
LK.setScore(LK.getScore() + hookedFish.points);
scoreTxt.setText('Score: ' + LK.getScore());
+ // Give money based on fish value
+ var moneyEarned = Math.floor(hookedFish.points / 2);
+ playerMoney += moneyEarned;
+ storage.setInt('playerMoney', playerMoney);
+ moneyTxt.setText('Money: ' + playerMoney);
// Remove fish
for (var i = fish.length - 1; i >= 0; i--) {
if (fish[i] === hookedFish) {
fish[i].destroy();
@@ -281,8 +443,13 @@
reelIn();
}
return;
}
+ // Switch bait on tap (when not casting or reeling)
+ if (!isCasting && !isReeling && x > 1500) {
+ switchBait();
+ return;
+ }
if (!isCasting && !isReeling) {
castStartX = x;
castStartY = y;
}
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