User prompt
As the points increase, the fish should come faster and there should be no catching time for the big fish that come after 500 Points and eat other fish. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Octopuses should not be able to come out of the water and should come more rarely.
User prompt
Ahtapotlar ekranınOctopuses should come from inside the water, not outside the screen
User prompt
Octopuses should come with a lot of space, and their scores should be a little lower
User prompt
After 250 points, a vertically swimming octopus should be added to the game, but they should appear at very close intervals. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
The user has 5 seconds to catch a fish when it appears. If player cannot catch it within 5 seconds, Player loses 1 life. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
But this is only true when the fish go in the opposite direction from where they came.
User prompt
For fish that leave the screen and cannot be caught, player lose 1 life.
User prompt
For fish that leave the screen and cannot be caught, we lose 1 life.
User prompt
We must have 3 lives in the game, one life must be lost for every fish not caught.
User prompt
Fish should be faster ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fish should come a little more frequently
User prompt
Some fish should come faster, some slower ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Remove the fishing rod, fishing line, and hook, instead the player must click on the fishes.
User prompt
The fishing line and hook must go in other directions and must be attached to the fishing rod and not outside of the fishing rod. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
The user must move the fishing line and hook, just like the Gold Mining game. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Yön tuşlarına basıldığında olta o yöne hareket etmeli ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Ekranda yön tuşları olmalı
User prompt
Fishing line and hook must be directed with the arrow keys. And it should work properly. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fishing line and hook should go wherever the user clicks. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fishing line and hook must be attached to the fishing rod ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add fishing rod asset
User prompt
Make your fishing rod system like a Gold Mining game ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Remove fishing rod
User prompt
İğnenin misinaya, oltanın altına, yani misinaya takılması gerekir. Ayrıca iğnenin her yöne hareket etmesi gerekir.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Fish = Container.expand(function (fishType, depth) {
var self = Container.call(this);
var fishGraphics = self.attachAsset(fishType, {
anchorX: 0.5,
anchorY: 0.5
});
self.fishType = fishType;
self.depth = depth;
self.speed = 2;
self.direction = Math.random() > 0.5 ? 1 : -1;
self.value = fishType === 'smallFish' ? 10 : fishType === 'mediumFish' ? 25 : fishType === 'largeFish' ? 50 : 100;
self.caught = false;
self.isBigFish = fishType === 'bigFish';
self.lastEatingTime = 0;
// Set fish speed based on type
if (fishType === 'smallFish') {
self.speed = 3;
} else if (fishType === 'mediumFish') {
self.speed = 2;
} else if (fishType === 'largeFish') {
self.speed = 1.5;
} else {
self.speed = 1; // Big fish is slowest
}
self.update = function () {
if (!self.caught) {
self.x += self.speed * self.direction;
// Reverse direction if fish goes off screen
if (self.x < -100 || self.x > 2148) {
self.direction *= -1;
}
// Big fish eating behavior
if (self.isBigFish && LK.ticks - self.lastEatingTime > 60) {
for (var i = fish.length - 1; i >= 0; i--) {
var otherFish = fish[i];
if (otherFish !== self && !otherFish.caught && !otherFish.isBigFish) {
var distance = Math.sqrt(Math.pow(self.x - otherFish.x, 2) + Math.pow(self.y - otherFish.y, 2));
if (distance < 80) {
// Eat the fish
otherFish.destroy();
fish.splice(i, 1);
self.lastEatingTime = LK.ticks;
break;
}
}
}
}
}
};
return self;
});
var FishingLine = Container.expand(function () {
var self = Container.call(this);
self.segments = [];
self.hook = self.addChild(LK.getAsset('hook', {
anchorX: 0.5,
anchorY: 0.5
}));
self.maxLength = 1500;
self.currentLength = 0;
self.isDropping = false;
self.isReeling = false;
self.caughtFish = null;
self.startDrop = function () {
if (!self.isDropping && !self.isReeling) {
self.isDropping = true;
LK.getSound('splash').play();
}
};
self.startReel = function () {
if (self.isDropping && !self.isReeling) {
self.isDropping = false;
self.isReeling = true;
}
};
self.update = function () {
// Drop line automatically
if (self.isDropping && self.currentLength < self.maxLength) {
self.currentLength += 8;
self.hook.x = 0; // Keep hook centered on line
self.hook.y = self.currentLength;
// Add line segments
if (self.currentLength % 20 === 0) {
var segment = self.addChild(LK.getAsset('fishingLine', {
anchorX: 0.5,
anchorY: 0.5
}));
segment.x = 0; // Keep segments aligned with fishing line center
segment.y = self.currentLength - 10;
self.segments.push(segment);
}
// Auto-reel when reaching max depth
if (self.currentLength >= self.maxLength) {
self.startReel();
}
}
// Reel in line
if (self.isReeling && self.currentLength > 0) {
self.currentLength -= 6;
self.hook.x = 0; // Keep hook centered on line
self.hook.y = self.currentLength;
// Remove line segments
if (self.segments.length > 0 && self.currentLength % 20 === 0) {
var segment = self.segments.pop();
if (segment) {
segment.destroy();
}
}
// Move caught fish with hook
if (self.caughtFish) {
self.caughtFish.x = self.x + self.hook.x;
self.caughtFish.y = self.y + self.hook.y;
}
// Check if fully reeled in
if (self.currentLength <= 0) {
self.isReeling = false;
if (self.caughtFish) {
// Score points
LK.setScore(LK.getScore() + self.caughtFish.value);
scoreTxt.setText(LK.getScore());
// Remove caught fish
self.caughtFish.destroy();
for (var i = fish.length - 1; i >= 0; i--) {
if (fish[i] === self.caughtFish) {
fish.splice(i, 1);
break;
}
}
self.caughtFish = null;
LK.getSound('catch').play();
}
}
}
// Check for fish collision
if (!self.caughtFish && self.currentLength > 0) {
for (var i = 0; i < fish.length; i++) {
var currentFish = fish[i];
if (!currentFish.caught && self.hook.intersects(currentFish)) {
self.caughtFish = currentFish;
currentFish.caught = true;
self.startReel();
break;
}
}
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Game variables
var fish = [];
var fishingLine;
var waterSurface = 500;
var fishSpawnTimer = 0;
// Create water
var water = game.addChild(LK.getAsset('water', {
anchorX: 0,
anchorY: 0,
x: 0,
y: waterSurface
}));
// Create fishing rod
var fishingRod = game.addChild(LK.getAsset('fishingRod', {
anchorX: 0.5,
anchorY: 1.0
}));
fishingRod.x = 1024;
fishingRod.y = waterSurface - 50;
// Create fishing line
fishingLine = game.addChild(new FishingLine());
fishingLine.x = fishingRod.x; // Attach to fishing rod x position
fishingLine.y = fishingRod.y; // Attach to fishing rod y position
// Create score display
var scoreTxt = new Text2('0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
scoreTxt.y = 50;
// Initialize score
scoreTxt.setText(LK.getScore());
// Spawn fish function
function spawnFish() {
var fishTypes = ['smallFish', 'mediumFish', 'largeFish'];
var depths = [200, 400, 600]; // Shallow, medium, deep
var typeIndex = Math.floor(Math.random() * fishTypes.length);
var fishType = fishTypes[typeIndex];
var depth = depths[typeIndex] + Math.random() * 200;
var newFish = new Fish(fishType, depth);
newFish.x = Math.random() > 0.5 ? -50 : 2098;
newFish.y = waterSurface + depth;
fish.push(newFish);
game.addChild(newFish);
}
// Automatic gold mining style controls - line drops and swings automatically
var swingDirection = 1;
var swingSpeed = 2;
var autoDropTimer = 0;
var autoDropDelay = 120; // 2 seconds before auto drop
// Start automatic swing and drop
function startMiningCycle() {
if (!fishingLine.isDropping && !fishingLine.isReeling) {
fishingLine.startDrop();
// Add swing motion using tween, anchored to fishing rod
tween(fishingLine, {
x: fishingRod.x + swingDirection * 200
}, {
duration: 2000,
easing: tween.easeInOut,
onFinish: function onFinish() {
swingDirection *= -1; // Reverse swing direction
}
});
}
}
// Touch controls for swinging direction
game.down = function (x, y, obj) {
// Change swing direction when touched
if (!fishingLine.isDropping && !fishingLine.isReeling) {
swingDirection = x < 1024 ? -1 : 1;
}
};
// No manual move control - everything is automatic like gold mining games
// Game variables for random spawning
var nextFishSpawnTime = 180 + Math.random() * 240; // Random interval between 3-7 seconds
// Main game loop
game.update = function () {
// Auto-start mining cycle
autoDropTimer++;
if (autoDropTimer >= autoDropDelay && !fishingLine.isDropping && !fishingLine.isReeling) {
startMiningCycle();
autoDropTimer = 0;
}
// Continue swinging during drop
if (fishingLine.isDropping) {
// Add subtle swing motion during drop, relative to fishing rod
fishingLine.x = fishingRod.x + Math.sin(LK.ticks * 0.05) * swingSpeed;
}
// Spawn fish randomly
fishSpawnTimer++;
if (fishSpawnTimer >= nextFishSpawnTime) {
spawnFish();
fishSpawnTimer = 0;
// Set next random spawn time (3-7 seconds)
nextFishSpawnTime = 180 + Math.random() * 240;
}
// Clean up fish that are off screen
for (var i = fish.length - 1; i >= 0; i--) {
var currentFish = fish[i];
if (currentFish.x < -200 || currentFish.x > 2248) {
currentFish.destroy();
fish.splice(i, 1);
}
}
// Spawn big fish after 500 points with random intervals
var currentScore = LK.getScore();
if (currentScore >= 500 && Math.random() < 0.001) {
// 0.1% chance per frame (10 times less frequent)
var bigFish = new Fish('bigFish', 300 + Math.random() * 400);
bigFish.x = Math.random() > 0.5 ? -100 : 2148;
bigFish.y = waterSurface + bigFish.depth;
fish.push(bigFish);
game.addChild(bigFish);
}
}; ===================================================================
--- original.js
+++ change.js
@@ -81,43 +81,26 @@
self.isReeling = true;
}
};
self.update = function () {
- // Arrow key movement when line is active or when line is being deployed
- var moveSpeed = 4;
- // Horizontal movement - move the entire fishing line position
- if (keys.left && self.x > 50) {
- self.x -= moveSpeed;
- }
- if (keys.right && self.x < 1998) {
- self.x += moveSpeed;
- }
- // Vertical movement - only when dropping
- if (self.isDropping) {
- if (keys.down && self.currentLength < self.maxLength) {
- self.currentLength += 8;
- self.hook.y = self.currentLength;
- // Add line segments
- if (self.currentLength % 20 === 0) {
- var segment = self.addChild(LK.getAsset('fishingLine', {
- anchorX: 0.5,
- anchorY: 0.5
- }));
- segment.x = 0;
- segment.y = self.currentLength - 10;
- self.segments.push(segment);
- }
+ // Drop line automatically
+ if (self.isDropping && self.currentLength < self.maxLength) {
+ self.currentLength += 8;
+ self.hook.x = 0; // Keep hook centered on line
+ self.hook.y = self.currentLength;
+ // Add line segments
+ if (self.currentLength % 20 === 0) {
+ var segment = self.addChild(LK.getAsset('fishingLine', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ }));
+ segment.x = 0; // Keep segments aligned with fishing line center
+ segment.y = self.currentLength - 10;
+ self.segments.push(segment);
}
- if (keys.up && self.currentLength > 0) {
- self.currentLength -= 8;
- self.hook.y = self.currentLength;
- // Remove line segments
- if (self.segments.length > 0 && self.currentLength % 20 === 0) {
- var segment = self.segments.pop();
- if (segment) {
- segment.destroy();
- }
- }
+ // Auto-reel when reaching max depth
+ if (self.currentLength >= self.maxLength) {
+ self.startReel();
}
}
// Reel in line
if (self.isReeling && self.currentLength > 0) {
@@ -214,66 +197,8 @@
LK.gui.top.addChild(scoreTxt);
scoreTxt.y = 50;
// Initialize score
scoreTxt.setText(LK.getScore());
-// Create on-screen arrow key buttons
-var leftArrow = new Text2('←', {
- size: 120,
- fill: 0xFFFFFF
-});
-leftArrow.anchor.set(0.5, 0.5);
-LK.gui.bottomLeft.addChild(leftArrow);
-leftArrow.x = 150;
-leftArrow.y = -150;
-var rightArrow = new Text2('→', {
- size: 120,
- fill: 0xFFFFFF
-});
-rightArrow.anchor.set(0.5, 0.5);
-LK.gui.bottomLeft.addChild(rightArrow);
-rightArrow.x = 350;
-rightArrow.y = -150;
-var upArrow = new Text2('↑', {
- size: 120,
- fill: 0xFFFFFF
-});
-upArrow.anchor.set(0.5, 0.5);
-LK.gui.bottomRight.addChild(upArrow);
-upArrow.x = -250;
-upArrow.y = -250;
-var downArrow = new Text2('↓', {
- size: 120,
- fill: 0xFFFFFF
-});
-downArrow.anchor.set(0.5, 0.5);
-LK.gui.bottomRight.addChild(downArrow);
-downArrow.x = -250;
-downArrow.y = -150;
-// Arrow button event handlers
-leftArrow.down = function (x, y, obj) {
- keys.left = true;
-};
-leftArrow.up = function (x, y, obj) {
- keys.left = false;
-};
-rightArrow.down = function (x, y, obj) {
- keys.right = true;
-};
-rightArrow.up = function (x, y, obj) {
- keys.right = false;
-};
-upArrow.down = function (x, y, obj) {
- keys.up = true;
-};
-upArrow.up = function (x, y, obj) {
- keys.up = false;
-};
-downArrow.down = function (x, y, obj) {
- keys.down = true;
-};
-downArrow.up = function (x, y, obj) {
- keys.down = false;
-};
// Spawn fish function
function spawnFish() {
var fishTypes = ['smallFish', 'mediumFish', 'largeFish'];
var depths = [200, 400, 600]; // Shallow, medium, deep
@@ -285,64 +210,52 @@
newFish.y = waterSurface + depth;
fish.push(newFish);
game.addChild(newFish);
}
-// Arrow key controls for fishing line
-var keys = {
- left: false,
- right: false,
- up: false,
- down: false
-};
-// Key event handlers
-LK.on('keydown', function (event) {
- switch (event.code) {
- case 'ArrowLeft':
- keys.left = true;
- break;
- case 'ArrowRight':
- keys.right = true;
- break;
- case 'ArrowUp':
- keys.up = true;
- break;
- case 'ArrowDown':
- keys.down = true;
- break;
+// Automatic gold mining style controls - line drops and swings automatically
+var swingDirection = 1;
+var swingSpeed = 2;
+var autoDropTimer = 0;
+var autoDropDelay = 120; // 2 seconds before auto drop
+// Start automatic swing and drop
+function startMiningCycle() {
+ if (!fishingLine.isDropping && !fishingLine.isReeling) {
+ fishingLine.startDrop();
+ // Add swing motion using tween, anchored to fishing rod
+ tween(fishingLine, {
+ x: fishingRod.x + swingDirection * 200
+ }, {
+ duration: 2000,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ swingDirection *= -1; // Reverse swing direction
+ }
+ });
}
-});
-LK.on('keyup', function (event) {
- switch (event.code) {
- case 'ArrowLeft':
- keys.left = false;
- break;
- case 'ArrowRight':
- keys.right = false;
- break;
- case 'ArrowUp':
- keys.up = false;
- break;
- case 'ArrowDown':
- keys.down = false;
- break;
- }
-});
-// Click to start fishing (drop line)
+}
+// Touch controls for swinging direction
game.down = function (x, y, obj) {
+ // Change swing direction when touched
if (!fishingLine.isDropping && !fishingLine.isReeling) {
- fishingLine.startDrop();
+ swingDirection = x < 1024 ? -1 : 1;
}
};
+// No manual move control - everything is automatic like gold mining games
// Game variables for random spawning
var nextFishSpawnTime = 180 + Math.random() * 240; // Random interval between 3-7 seconds
// Main game loop
game.update = function () {
- // Auto-start reeling if line reaches surface or max depth
- if (fishingLine.isDropping && !fishingLine.isReeling) {
- if (fishingLine.currentLength >= fishingLine.maxLength || fishingLine.currentLength <= 0) {
- fishingLine.startReel();
- }
+ // Auto-start mining cycle
+ autoDropTimer++;
+ if (autoDropTimer >= autoDropDelay && !fishingLine.isDropping && !fishingLine.isReeling) {
+ startMiningCycle();
+ autoDropTimer = 0;
}
+ // Continue swinging during drop
+ if (fishingLine.isDropping) {
+ // Add subtle swing motion during drop, relative to fishing rod
+ fishingLine.x = fishingRod.x + Math.sin(LK.ticks * 0.05) * swingSpeed;
+ }
// Spawn fish randomly
fishSpawnTimer++;
if (fishSpawnTimer >= nextFishSpawnTime) {
spawnFish();
Rubber Hose Style Blue Fish. In-Game asset. 2d. High contrast. No shadows
Rubber Hose Style Green Medium-Sized fish. In-Game asset. 2d. High contrast. No shadows
Rubber Hose Style Orange Happy Fish. In-Game asset. 2d. High contrast. No shadows
Rubber Hose Style Swimming pose Shark. It's Angry. In-Game asset. 2d. High contrast. No shadows
Rubber Hose Style octopus. In-Game asset. 2d. High contrast. No shadows