User prompt
çakıl taşları etrafta dağınık olmasın en dipte olsunlar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
suyun dibinde çakıl taşları ve biraz büyük kayalar olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
havada bulut olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
yosunların olduğu yerde daha fazla yosun olsun birde olta masasını kaldır olta değiştirme ise rod level yazısının altında bir kutucuk olsun bu kutucuğa bastığımızda karşımıza bir ekran çıksın bu ekranda 8 tane oltamız ve fiyatları geri gelsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
suda baloncuklarda olsun birde yosunlar fazla hareketli olmasın yosun gibi davransın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
yosunlar gölün alt köşelerinde olsunlar birde orta balık ve küçük balık olmasın artık diğer bütün balıklar gölde her 1 dakikada doğsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
gölde yosun olsun bu yosunlar dalgalar ile hareket etsin birde yeni çıkan 8 balıkta gelsin hep aynı balıklar doğmasın onlarda doğsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
hep aynı tür balıklar gelmesin en pahalı balıklar hariç diğer balıklardan her 1 dakikada 1 er tane gelsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
8 yeni balık türü daha ekle oyuna
User prompt
masanın üzerindeki oltalar ve fiyatları oyun boyunca hep masada olsun hiç yok olmasınlar
User prompt
masa ve üzerindeki oltalar aşağıda çantanın sağında olsun masadaki oltalar ve fiyat ekranı biraz büyük olsun her olta değiştirdiğimizde ise yeni balık türleri eklensin oyuna ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
masada 8 tane olta olsun bu oltaların fiyatı olsun oltaların seviyelerine göre fiyatları değişsin ama oltalar pahalı olsun eğer alacağımız oltanın değerinde paramız varsa oltayı satın alabilelim son seviye oltayı alınca ise olta seviyesi kısmında Maks. yazsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
çantayı açtığımızda çıkan balık isimleri çantayı kapatınca çantayla beraber kapansın birde sol üst en köşede bir masa olsun masada 15 tane olta olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
biz hangi yöne basarsak kayık o yöne gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
tutğumuz balıkların ismi ekrana fiyatıyla birlikte çıkıp 4 saniyede geri gitsin birde tuttuğumuz balıklar kayığın altında durmasın direkt çantaya girsin çantaya giren balıkların sadece ismi yazsın birde kulübede oltada olsun yemlerin altında aldığımız oltanın bir üst seviyesi her olta değiştirdiğimizde orda olsun birde gölün neresine tıklarsak oraya oltayı atsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Bag = Container.expand(function () {
var self = Container.call(this);
// Create bag graphics
var bagBody = self.attachAsset('bag', {
anchorX: 0.5,
anchorY: 1
});
var bagHandle = self.attachAsset('bagHandle', {
anchorX: 0.5,
anchorY: 1,
x: 0,
y: -100
});
// Store fish in bag
self.fishInventory = [];
self.addFish = function (fishType, points) {
self.fishInventory.push({
type: fishType,
points: points,
price: Math.floor(points / 2)
});
};
self.down = function () {
showInventory();
};
return self;
});
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 Boat = Container.expand(function () {
var self = Container.call(this);
// Create boat hull
var boatHull = self.attachAsset('boat', {
anchorX: 0.5,
anchorY: 0.5
});
// Array to hold caught fish
self.caughtFish = [];
// Boat movement properties
self.speed = 3;
self.isMoving = false;
self.targetX = 0;
// Method to add fish to boat
self.addFish = function (fish) {
// Position fish in boat
var fishInBoat = self.addChild(fish);
var offset = self.caughtFish.length * 25 - 50; // Spread fish across boat
fishInBoat.x = offset;
fishInBoat.y = -20;
fishInBoat.scaleX = 0.6;
fishInBoat.scaleY = 0.6;
self.caughtFish.push(fishInBoat);
};
// Method to move boat to target position
self.moveTo = function (targetX) {
if (targetX < 100) targetX = 100;
if (targetX > 1948) targetX = 1948;
self.targetX = targetX;
self.isMoving = true;
};
self.update = function () {
if (self.isMoving) {
var distance = self.targetX - self.x;
if (Math.abs(distance) > self.speed) {
self.x += distance > 0 ? self.speed : -self.speed;
} else {
self.x = self.targetX;
self.isMoving = false;
}
}
};
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;
});
var Shop = Container.expand(function () {
var self = Container.call(this);
// Shop background
var shopBg = self.attachAsset('cabin', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3,
scaleY: 2.5
});
self.visible = false;
self.isOpen = false;
self.fishingRods = [];
for (var i = 0; i < 15; i++) {
self.fishingRods.push({
level: i + 1,
price: 50 + i * 25,
catchBonus: 1 + i * 0.1
});
}
// Create current rod display
var currentRodDisplay = self.addChild(LK.getAsset('fishingRod', {
anchorX: 0.5,
anchorY: 0.5,
x: 100,
y: -100,
scaleX: 0.5,
scaleY: 0.5
}));
var currentRodText = new Text2('Current Rod: Level ' + currentRodLevel, {
size: 30,
fill: 0xFFFFFF
});
currentRodText.anchor.set(0.5, 0.5);
currentRodText.x = 100;
currentRodText.y = -50;
self.addChild(currentRodText);
self.open = function () {
self.visible = true;
self.isOpen = true;
game.isPaused = true;
// Update current rod display
currentRodText.setText('Current Rod: Level ' + currentRodLevel);
};
self.close = function () {
self.visible = false;
self.isOpen = false;
game.isPaused = false;
};
self.down = function (x, y) {
if (x > 0) {
// Right side - buy rods and bait
var rodIndex = Math.floor((y + 200) / 50);
if (rodIndex >= 0 && rodIndex < 15) {
var rod = self.fishingRods[rodIndex];
if (playerMoney >= rod.price) {
playerMoney -= rod.price;
storage.playerMoney = playerMoney;
currentRodLevel = rod.level;
storage.rodLevel = currentRodLevel;
moneyTxt.setText('Money: ' + playerMoney);
}
}
} else {
// Left side - sell fish
if (inventoryBag.fishInventory.length > 0) {
var fish = inventoryBag.fishInventory.pop();
playerMoney += fish.price;
storage.playerMoney = playerMoney;
moneyTxt.setText('Money: ' + playerMoney);
}
}
};
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;
var clickCount = 0;
var lastClickX = 0;
var lastClickY = 0;
var targetCastX = 0;
var targetCastY = 0;
var clickTimeout = null;
// Bait system variables
var playerMoney = storage.playerMoney || 100;
var currentBait = 'basic';
var baitCount = {
basic: storage.basicBait || 5,
premium: storage.premiumBait || 0,
golden: storage.goldenBait || 0
};
var currentRodLevel = storage.rodLevel || 1;
var inventoryOpen = false;
var shopOpen = false;
// Create water
var water = game.addChild(LK.getAsset('water', {
anchorX: 0,
anchorY: 0,
x: 0,
y: waterSurface
}));
// Create boat
var boat = game.addChild(new Boat());
boat.x = 1024;
boat.y = waterSurface - 30;
// Create player on boat
var player = boat.addChild(LK.getAsset('player', {
anchorX: 0.5,
anchorY: 1,
x: 0,
y: -30
}));
// Create fishing rod on boat
var fishingRod = boat.addChild(LK.getAsset('fishingRod', {
anchorX: 0.5,
anchorY: 1,
x: 0,
y: -20
}));
// 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 inventory bag at bottom of screen
var inventoryBag = game.addChild(new Bag());
inventoryBag.x = 1024;
inventoryBag.y = 2732;
// Create table with fishing rods at bottom right near the bag
var table = game.addChild(LK.getAsset('table', {
anchorX: 0,
anchorY: 1,
x: 1300,
y: 2732
}));
// Create 8 fishing rods on the table
var tableRods = [];
var tableRodPrices = [];
for (var i = 0; i < 8; i++) {
var rod = table.addChild(LK.getAsset('fishingRod', {
anchorX: 0.5,
anchorY: 0.5,
x: i % 4 * 80 + 60,
y: -Math.floor(i / 4) * 120 - 80,
scaleX: 0.5,
scaleY: 0.5,
rotation: Math.PI / 4
}));
tableRods.push(rod);
// Create price text for each rod
var rodPrice = 500 + i * 200; // Expensive pricing: 500, 700, 900, etc.
var priceText = new Text2('$' + rodPrice, {
size: 40,
fill: 0xFFD700
});
priceText.anchor.set(0.5, 0.5);
priceText.x = i % 4 * 80 + 60;
priceText.y = -Math.floor(i / 4) * 120 - 40;
table.addChild(priceText);
tableRodPrices.push({
price: rodPrice,
text: priceText
});
}
// Create shop interface
var shop = game.addChild(new Shop());
shop.x = 1024;
shop.y = 1366;
// Create UI
var scoreTxt = new Text2('Score: 0', {
size: 60,
fill: 0xFFFFFF
});
// Fish catch notification
var catchNotificationTxt = new Text2('', {
size: 80,
fill: 0xFFD700
});
catchNotificationTxt.anchor.set(0.5, 0.5);
catchNotificationTxt.x = 1024;
catchNotificationTxt.y = 1366;
catchNotificationTxt.visible = false;
game.addChild(catchNotificationTxt);
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var instructionTxt = new Text2('Tap on lake to cast your line!', {
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);
var rodLevelTxt = new Text2(currentRodLevel >= 8 ? 'Rod Level: Maks.' : 'Rod Level: ' + currentRodLevel, {
size: 40,
fill: 0xFFD700
});
rodLevelTxt.anchor.set(0, 0);
rodLevelTxt.y = 120;
LK.gui.topLeft.addChild(rodLevelTxt);
// 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.playerMoney = playerMoney;
storage[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('Tap on lake to cast your line!');
}, 1500);
} else {
instructionTxt.setText('Not enough money!');
LK.setTimeout(function () {
instructionTxt.setText('Tap on lake to cast your line!');
}, 1500);
}
}
// Inventory display elements array for proper cleanup
var inventoryDisplayElements = [];
// Show inventory function
function showInventory() {
if (inventoryOpen) return;
inventoryOpen = true;
// Clear previous display elements
inventoryDisplayElements = [];
// Create inventory display
var inventoryBg = game.addChild(LK.getAsset('cabin', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 4,
scaleY: 3
}));
inventoryDisplayElements.push(inventoryBg);
var inventoryTitle = new Text2('Fish Inventory', {
size: 60,
fill: 0xFFFFFF
});
inventoryTitle.anchor.set(0.5, 0.5);
inventoryTitle.x = 1024;
inventoryTitle.y = 800;
game.addChild(inventoryTitle);
inventoryDisplayElements.push(inventoryTitle);
// Display only fish names in bag
for (var i = 0; i < inventoryBag.fishInventory.length; i++) {
var fish = inventoryBag.fishInventory[i];
var fishText = new Text2(fish.type.charAt(0).toUpperCase() + fish.type.slice(1) + ' Fish', {
size: 40,
fill: 0xFFFFFF
});
fishText.anchor.set(0.5, 0.5);
fishText.x = 1024;
fishText.y = 900 + i * 60;
game.addChild(fishText);
inventoryDisplayElements.push(fishText);
}
// Close button
var closeBtn = game.addChild(LK.getAsset('bag', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1800
}));
inventoryDisplayElements.push(closeBtn);
closeBtn.down = function () {
// Remove all inventory display elements
for (var i = 0; i < inventoryDisplayElements.length; i++) {
game.removeChild(inventoryDisplayElements[i]);
}
inventoryDisplayElements = [];
inventoryOpen = false;
};
}
// Show shop function
function showShop() {
if (shopOpen) return;
shopOpen = true;
shop.open();
}
// 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;
}
}
}
// Fish types available by rod level
var fishTypesByLevel = {
1: ['small'],
2: ['small', 'medium'],
3: ['small', 'medium', 'tropical'],
4: ['small', 'medium', 'tropical'],
5: ['small', 'medium', 'tropical', 'large'],
6: ['small', 'medium', 'tropical', 'large'],
7: ['small', 'medium', 'tropical', 'large', 'rare'],
8: ['small', 'medium', 'tropical', 'large', 'rare']
};
// Spawn initial fish
function spawnFish() {
var availableFishTypes = fishTypesByLevel[currentRodLevel] || ['small'];
var fishType = availableFishTypes[Math.floor(Math.random() * availableFishTypes.length)];
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('Tap on lake to cast your line!');
}, 2000);
return;
}
isCasting = true;
// Use bait
baitCount[currentBait] -= 1;
storage[currentBait + 'Bait'] = baitCount[currentBait];
baitTxt.setText('Bait: ' + currentBait.charAt(0).toUpperCase() + currentBait.slice(1) + ' (' + baitCount[currentBait] + ')');
var rodTipX = boat.x + fishingRod.x;
var rodTipY = boat.y + 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.playerMoney = playerMoney;
moneyTxt.setText('Money: ' + playerMoney);
// Show fish catch notification
var fishPrice = Math.floor(hookedFish.points / 2);
catchNotificationTxt.setText(hookedFish.fishType.charAt(0).toUpperCase() + hookedFish.fishType.slice(1) + ' Fish - $' + fishPrice);
catchNotificationTxt.visible = true;
// Hide notification after 4 seconds
LK.setTimeout(function () {
catchNotificationTxt.visible = false;
}, 4000);
// Add fish directly to bag (don't add to boat)
var caughtFish = null;
for (var i = fish.length - 1; i >= 0; i--) {
if (fish[i] === hookedFish) {
caughtFish = fish[i];
fish.splice(i, 1);
break;
}
}
if (caughtFish) {
// Remove fish from game container
game.removeChild(caughtFish);
// Add to inventory bag directly (skip boat)
inventoryBag.addFish(caughtFish.fishType, caughtFish.points);
}
// 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('Tap on lake to cast your line!');
}
// Game events
game.down = function (x, y, obj) {
if (isReeling && hookedFish) {
reelProgress += 20;
if (reelProgress >= 100) {
reelIn();
}
return;
}
// Check if clicking on table rods
if (x >= 1300 && x <= 1700 && y >= 2492 && y <= 2732) {
var rodIndex = Math.floor((x - 1360) / 80) + Math.floor((2732 - y - 40) / 120) * 4;
if (rodIndex >= 0 && rodIndex < 8) {
var targetRodLevel = rodIndex + 1;
var rodPrice = 500 + rodIndex * 200;
// Check if this is the next level rod and player has enough money
if (targetRodLevel === currentRodLevel + 1 && playerMoney >= rodPrice) {
playerMoney -= rodPrice;
storage.playerMoney = playerMoney;
currentRodLevel = targetRodLevel;
storage.rodLevel = currentRodLevel;
moneyTxt.setText('Money: ' + playerMoney);
// Update rod level display
if (currentRodLevel >= 8) {
rodLevelTxt.setText('Rod Level: Maks.');
} else {
rodLevelTxt.setText('Rod Level: ' + currentRodLevel);
}
// Clear existing fish and spawn new types for the new rod level
for (var f = fish.length - 1; f >= 0; f--) {
game.removeChild(fish[f]);
fish.splice(f, 1);
}
// Spawn new fish based on rod level
for (var newF = 0; newF < 8; newF++) {
spawnFish();
}
instructionTxt.setText('Rod upgraded to level ' + currentRodLevel + '! New fish types available!');
LK.setTimeout(function () {
instructionTxt.setText('Tap on lake to cast your line!');
}, 2000);
} else if (targetRodLevel !== currentRodLevel + 1) {
instructionTxt.setText('Must buy rods in order!');
LK.setTimeout(function () {
instructionTxt.setText('Tap on lake to cast your line!');
}, 2000);
} else {
instructionTxt.setText('Not enough money for this rod!');
LK.setTimeout(function () {
instructionTxt.setText('Tap on lake to cast your line!');
}, 2000);
}
}
return;
}
// Check if boat is near cabin for shop interaction
if (!isCasting && !isReeling && Math.abs(boat.x - cabin.x) < 100 && x > 1400 && x < 1800 && y < waterSurface + 100) {
showShop();
return;
}
// Switch bait on tap (when not casting or reeling)
if (!isCasting && !isReeling && x > 1500) {
switchBait();
return;
}
if (!isCasting && !isReeling) {
// Check if click is in water area (entire lake surface)
if (y > waterSurface && x >= 0 && x <= 2048) {
// Cast line directly to clicked location
castLine(x, y);
} else {
// Move boat towards clicked position when clicking anywhere else
boat.moveTo(x);
}
}
};
game.up = function (x, y, obj) {
// Removed drag-to-cast functionality - now using 3-tap system
};
// Spawn new fish periodically
var fishSpawnTimer = 0;
game.update = function () {
// Update boat
boat.update();
// 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 = boat.x + fishingRod.x;
var targetY = boat.y + 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
@@ -406,38 +406,38 @@
// Create inventory bag at bottom of screen
var inventoryBag = game.addChild(new Bag());
inventoryBag.x = 1024;
inventoryBag.y = 2732;
-// Create table with fishing rods in top-left corner
+// Create table with fishing rods at bottom right near the bag
var table = game.addChild(LK.getAsset('table', {
anchorX: 0,
- anchorY: 0,
- x: 150,
- y: 150
+ anchorY: 1,
+ x: 1300,
+ y: 2732
}));
// Create 8 fishing rods on the table
var tableRods = [];
var tableRodPrices = [];
for (var i = 0; i < 8; i++) {
var rod = table.addChild(LK.getAsset('fishingRod', {
anchorX: 0.5,
anchorY: 0.5,
- x: i % 4 * 70 + 50,
- y: Math.floor(i / 4) * 80 + 60,
- scaleX: 0.3,
- scaleY: 0.3,
+ x: i % 4 * 80 + 60,
+ y: -Math.floor(i / 4) * 120 - 80,
+ scaleX: 0.5,
+ scaleY: 0.5,
rotation: Math.PI / 4
}));
tableRods.push(rod);
// Create price text for each rod
var rodPrice = 500 + i * 200; // Expensive pricing: 500, 700, 900, etc.
var priceText = new Text2('$' + rodPrice, {
- size: 25,
+ size: 40,
fill: 0xFFD700
});
priceText.anchor.set(0.5, 0.5);
- priceText.x = i % 4 * 70 + 50;
- priceText.y = Math.floor(i / 4) * 80 + 90;
+ priceText.x = i % 4 * 80 + 60;
+ priceText.y = -Math.floor(i / 4) * 120 - 40;
table.addChild(priceText);
tableRodPrices.push({
price: rodPrice,
text: priceText
@@ -597,23 +597,23 @@
break;
}
}
}
+// Fish types available by rod level
+var fishTypesByLevel = {
+ 1: ['small'],
+ 2: ['small', 'medium'],
+ 3: ['small', 'medium', 'tropical'],
+ 4: ['small', 'medium', 'tropical'],
+ 5: ['small', 'medium', 'tropical', 'large'],
+ 6: ['small', 'medium', 'tropical', 'large'],
+ 7: ['small', 'medium', 'tropical', 'large', 'rare'],
+ 8: ['small', 'medium', 'tropical', 'large', 'rare']
+};
// 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 availableFishTypes = fishTypesByLevel[currentRodLevel] || ['small'];
+ var fishType = availableFishTypes[Math.floor(Math.random() * availableFishTypes.length)];
var newFish = game.addChild(new Fish(fishType));
newFish.x = Math.random() * 1948 + 50;
newFish.y = waterSurface + 150 + Math.random() * 1000;
newFish.startX = newFish.x;
@@ -741,10 +741,10 @@
}
return;
}
// Check if clicking on table rods
- if (x >= 150 && x <= 550 && y >= 150 && y <= 450) {
- var rodIndex = Math.floor((x - 200) / 70) + Math.floor((y - 210) / 80) * 4;
+ if (x >= 1300 && x <= 1700 && y >= 2492 && y <= 2732) {
+ var rodIndex = Math.floor((x - 1360) / 80) + Math.floor((2732 - y - 40) / 120) * 4;
if (rodIndex >= 0 && rodIndex < 8) {
var targetRodLevel = rodIndex + 1;
var rodPrice = 500 + rodIndex * 200;
// Check if this is the next level rod and player has enough money
@@ -759,9 +759,18 @@
rodLevelTxt.setText('Rod Level: Maks.');
} else {
rodLevelTxt.setText('Rod Level: ' + currentRodLevel);
}
- instructionTxt.setText('Rod upgraded to level ' + currentRodLevel + '!');
+ // Clear existing fish and spawn new types for the new rod level
+ for (var f = fish.length - 1; f >= 0; f--) {
+ game.removeChild(fish[f]);
+ fish.splice(f, 1);
+ }
+ // Spawn new fish based on rod level
+ for (var newF = 0; newF < 8; newF++) {
+ spawnFish();
+ }
+ instructionTxt.setText('Rod upgraded to level ' + currentRodLevel + '! New fish types available!');
LK.setTimeout(function () {
instructionTxt.setText('Tap on lake to cast your line!');
}, 2000);
} else if (targetRodLevel !== currentRodLevel + 1) {
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