User prompt
size 2 ye geçmek için gereken puan 100 olsun ve her bir sonraki boyuta geçmek için gereken puanı ikiye katlayarak ekle yani size 3 için 300 olmalı size 4 için 700 olmalı size 5 için 1500 olmalı score 3000 olunca oyunu kazanalım
User prompt
smallfish çıkma olasılığını arttır hugefish ve large fish çıkma olasılığını %30 azalt
User prompt
tekrar azalt
User prompt
balıkşarın sıklığını %20 azalt tekrar
User prompt
balıkşarın sıklığını %20 azalt
User prompt
salyangoz her 100 puanda yeni boyuta geçiş yapsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
score 1000 olunca kazanalım
User prompt
skor 500 olunca kazanalım
User prompt
balık spawnlanma oranı küçük balıktan büyük balığa doğru azalsın
User prompt
okyanus “Feeding Game” veya “Growth Game” gibi genişlesin
User prompt
okyanus küçülmeyecek genişleyecek yani biz nesneleri daha küçük görücez ama bakış açımız genişleyecek ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
okyanus her küçüldğünde bizde o alanın dışına çıkabilelim balıklar da çıksın
User prompt
okyanusun küçülmesi lazım
User prompt
okyanus büyüdükten sonra o alana girebilelim ve orada da balıklar spawn olmaya başlasın
User prompt
okyanus büyümesin küçülsün ve daha çok balık görebilelim
User prompt
biz her bir boyut büyüdüğümüzde okyanus da genişlesin
Code edit (1 edits merged)
Please save this source code
User prompt
Ocean Hunter: Grow and Devour
Initial prompt
yedikçe büyüdüğümüz okyanusta geçen bir oyun karakterimiz ahtapot ve kendinden küçük balıkları yiyor yedikçe belli bir puanda büyüyerek daha büyük balıkları yiyebiliyor
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Fish = Container.expand(function (fishType) {
var self = Container.call(this);
self.fishType = fishType || 'smallFish';
self.fishSize = 1;
if (self.fishType === 'smallFish') {
self.fishSize = 1;
} else if (self.fishType === 'mediumFish') {
self.fishSize = 2;
} else if (self.fishType === 'largeFish') {
self.fishSize = 3;
} else if (self.fishType === 'hugeFish') {
self.fishSize = 4;
}
var fishGraphics = self.attachAsset(self.fishType, {
anchorX: 0.5,
anchorY: 0.5
});
self.speedX = (Math.random() - 0.5) * 3;
self.speedY = (Math.random() - 0.5) * 3;
self.update = function () {
self.x += self.speedX;
self.y += self.speedY;
// Use expanding ocean bounds for feeding game
var currentWidth = oceanWidth;
var currentHeight = oceanHeight;
// Bounce off edges
if (self.x < 0 || self.x > currentWidth) {
self.speedX *= -1;
}
if (self.y < 0 || self.y > currentHeight) {
self.speedY *= -1;
}
// Keep within bounds
self.x = Math.max(0, Math.min(currentWidth, self.x));
self.y = Math.max(0, Math.min(currentHeight, self.y));
};
return self;
});
var Octopus = Container.expand(function () {
var self = Container.call(this);
self.octopusSize = 1;
var octopusGraphics = self.attachAsset('octopus', {
anchorX: 0.5,
anchorY: 0.5
});
self.grow = function () {
self.octopusSize++;
// Scale up the octopus
var newScale = 1 + (self.octopusSize - 1) * 0.3;
tween(octopusGraphics, {
scaleX: newScale,
scaleY: newScale
}, {
duration: 500
});
// Expand the ocean bounds like in feeding games
oceanWidth += 400; // Increase ocean width by 400 pixels
oceanHeight += 400; // Increase ocean height by 400 pixels
// Use tween to smoothly expand the camera view
tween(game, {
scaleX: game.scaleX * 0.9,
scaleY: game.scaleY * 0.9
}, {
duration: 1000
});
LK.getSound('grow').play();
};
self.canEat = function (fish) {
return self.octopusSize >= fish.fishSize;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x006994
});
/****
* Game Code
****/
// Initialize game scale for ocean expansion
game.scaleX = 1;
game.scaleY = 1;
// Track ocean bounds for feeding game expansion
var oceanWidth = 2048;
var oceanHeight = 2732;
var octopus = game.addChild(new Octopus());
octopus.x = 1024;
octopus.y = 1366;
var fish = [];
var fishTypes = ['smallFish', 'mediumFish', 'largeFish', 'hugeFish'];
// Create initial fish (reduced from 25 to 20 for 20% less spawning)
for (var i = 0; i < 20; i++) {
var currentWidth = oceanWidth;
var currentHeight = oceanHeight;
// Weighted spawning - smaller fish spawn more frequently
var rand = Math.random();
var fishType;
if (rand < 0.5) {
fishType = 'smallFish'; // 50% chance
} else if (rand < 0.75) {
fishType = 'mediumFish'; // 25% chance
} else if (rand < 0.9) {
fishType = 'largeFish'; // 15% chance
} else {
fishType = 'hugeFish'; // 10% chance
}
var newFish = new Fish(fishType);
newFish.x = Math.random() * currentWidth;
newFish.y = Math.random() * currentHeight;
fish.push(newFish);
game.addChild(newFish);
}
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var sizeTxt = new Text2('Size: 1', {
size: 60,
fill: 0xFFFFFF
});
sizeTxt.anchor.set(0, 0);
sizeTxt.x = 150;
sizeTxt.y = 100;
LK.gui.topLeft.addChild(sizeTxt);
var dragNode = null;
function handleMove(x, y, obj) {
if (dragNode) {
dragNode.x = x;
dragNode.y = y;
// Calculate current ocean bounds based on game scale
var currentWidth = 2048 * (game.scaleX || 1);
var currentHeight = 2732 * (game.scaleY || 1);
// Keep octopus within expanding ocean bounds
dragNode.x = Math.max(40, Math.min(oceanWidth - 40, dragNode.x));
dragNode.y = Math.max(40, Math.min(oceanHeight - 40, dragNode.y));
}
}
game.move = handleMove;
game.down = function (x, y, obj) {
dragNode = octopus;
handleMove(x, y, obj);
};
game.up = function (x, y, obj) {
dragNode = null;
};
game.update = function () {
// Check collisions between octopus and fish
for (var i = fish.length - 1; i >= 0; i--) {
var currentFish = fish[i];
if (octopus.intersects(currentFish)) {
if (octopus.canEat(currentFish)) {
// Eat the fish
var points = currentFish.fishSize * 10;
var oldScore = LK.getScore();
LK.setScore(oldScore + points);
LK.getSound('eat').play();
// Remove fish
currentFish.destroy();
fish.splice(i, 1);
// Check if octopus should grow every 100 points
var newScore = LK.getScore();
var oldLevel = Math.floor(oldScore / 100);
var newLevel = Math.floor(newScore / 100);
if (newLevel > oldLevel) {
octopus.grow();
sizeTxt.setText('Size: ' + octopus.octopusSize);
}
// Spawn 1 new fish within expanding ocean bounds (reduced from 2 for 20% less spawning)
for (var j = 0; j < 1; j++) {
var currentWidth = oceanWidth;
var currentHeight = oceanHeight;
// Weighted spawning - smaller fish spawn more frequently
var rand = Math.random();
var fishType;
if (rand < 0.5) {
fishType = 'smallFish'; // 50% chance
} else if (rand < 0.75) {
fishType = 'mediumFish'; // 25% chance
} else if (rand < 0.9) {
fishType = 'largeFish'; // 15% chance
} else {
fishType = 'hugeFish'; // 10% chance
}
var newFish = new Fish(fishType);
newFish.x = Math.random() * currentWidth;
newFish.y = Math.random() * currentHeight;
fish.push(newFish);
game.addChild(newFish);
}
} else {
// Game over - touched larger fish
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
}
}
// Update score display
scoreTxt.setText('Score: ' + LK.getScore());
// Win condition - reach score 1000
if (LK.getScore() >= 1000) {
LK.showYouWin();
}
}; ===================================================================
--- original.js
+++ change.js
@@ -99,10 +99,10 @@
octopus.x = 1024;
octopus.y = 1366;
var fish = [];
var fishTypes = ['smallFish', 'mediumFish', 'largeFish', 'hugeFish'];
-// Create initial fish
-for (var i = 0; i < 25; i++) {
+// Create initial fish (reduced from 25 to 20 for 20% less spawning)
+for (var i = 0; i < 20; i++) {
var currentWidth = oceanWidth;
var currentHeight = oceanHeight;
// Weighted spawning - smaller fish spawn more frequently
var rand = Math.random();
@@ -178,10 +178,10 @@
if (newLevel > oldLevel) {
octopus.grow();
sizeTxt.setText('Size: ' + octopus.octopusSize);
}
- // Spawn 2 new fish within expanding ocean bounds
- for (var j = 0; j < 2; j++) {
+ // Spawn 1 new fish within expanding ocean bounds (reduced from 2 for 20% less spawning)
+ for (var j = 0; j < 1; j++) {
var currentWidth = oceanWidth;
var currentHeight = oceanHeight;
// Weighted spawning - smaller fish spawn more frequently
var rand = Math.random();
tatlı balık görseli. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
kırmızı renk tatlı balık görseli. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
yeşil renk tatlı balık görseli. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
kalamar görseli. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
okyanusun derinlikleri okyanusun üstü görünmesin renk geçişleri olabilir. 2d oyun içi asset balık olmasın
mürekkep balığı. In-Game asset. 2d. High contrast. No shadows
coin image üzerinde balık işareti olan bir madeni para altın renkte. In-Game asset. 2d. High contrast. No shadows
korkunç bir deniz canavarı. In-Game asset. 2d. High contrast. No shadows
tatlı ahtapot mor